Announcement

Collapse
No announcement yet.

how can I make the GPO applyed on the LAPTOP Ony

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • how can I make the GPO applyed on the LAPTOP Ony

    Hi
    I have a network that have Laptop and desktop

    there is a GPO that I use to install the printer and its applied on the user confiuration as long as the printer installation can not be a computer configuration
    I need to install all the printer (6 printers ) on the laptop and only a printer named as (BigPrinter) on the desktop computers
    how can this be done

    I make some thing on my maind but I dont know how to apply it as long I dont know VBS good

    the way is :

    if the first 2 letter of the Computer name id "de" from dell then a command will be used to install all the printer
    But if first 2 letter was "PC" the this is a desktop and only one printer will be installed

    I dont know if there is any other way

    Thanks

  • #2
    Re: how can I make the GPO applyed on the LAPTOP Ony

    Make 2 OUs
    Move the laptops into one
    Move the desktops into the other
    Apply appropriate GPs

    Tom
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Re: how can I make the GPO applyed on the LAPTOP Ony

      This is the Script
      It work Fine

      Set oNet = CreateObject("Wscript.Network")
      Set WshNetwork = CreateObject("WScript.Network")
      strComputer = UCase(oNet.ComputerName)
      IF Left(strComputer,2) = "DE" or Left(strComputer,2) = "LA" THEN
      WshNetwork.AddWindowsPrinterConnection "\\main\BigBoss"
      WshNetwork.AddWindowsPrinterConnection "\\main\editor1"
      WshNetwork.AddWindowsPrinterConnection "\\main\editor2"
      WshNetwork.AddWindowsPrinterConnection "\\main\editor3"
      WshNetwork.AddWindowsPrinterConnection "\\main\editor4"
      WshNetwork.AddWindowsPrinterConnection "\\main\f2_editor1"
      WshNetwork.AddWindowsPrinterConnection "\\main\f2_editor2"
      WshNetwork.AddWindowsPrinterConnection "\\main\Secertarya"
      WshNetwork.AddWindowsPrinterConnection "\\main\type1"
      WshNetwork.AddWindowsPrinterConnection "\\main\type2"
      WshNetwork.AddWindowsPrinterConnection "\\main\type3"
      End if

      if Left(strComputer,5) = "PC-09" or Left(strComputer,5) = "PC-01" or Left(strComputer,5) = "PC-02" or Left(strComputer,5) = "PC-08" then
      WshNetwork.AddWindowsPrinterConnection "\\main\type1"
      WshNetwork.AddWindowsPrinterConnection "\\main\type2"
      WshNetwork.AddWindowsPrinterConnection "\\main\type3"
      end if


      if Left(strComputer,5) = "PC-07" then
      WshNetwork.AddWindowsPrinterConnection "\\main\BigBoss"
      end if

      Comment


      • #4
        Re: how can I make the GPO applyed on the LAPTOP Ony

        Farisnt,

        What you could do alternatively is set an environment variable in the operating system called COMPUTER_MODEL and assign either the value "laptop" or "desktop" according to what the machine type is.

        This sets a global computer variable which is not dependent on the machine name.

        And can be read by as you said VBS script and build the printer appropriate for that machine model.

        To do this simply open a CMD prompt and type set COMPUTER_MODEL="value". This can also be scripted but generally it is a good idea to create this value when you are initially creating your base images for workstations.

        Type the set command and <enter> to view your new variable.

        Hope this helps somewhat

        Comment

        Working...
        X