+ Reply to Thread
Results 1 to 3 of 3
  1. Member
    Join Date
    Mar 2006

    A+, NET+, MCP 70-290, 2 X City & Guilds IT.

    Default group policy to deploy printers

    I am looking to deploy printers automatically by department using group policy in server 2003. I am testing this solution using Microsoft’s vpc with 1 server 2k3 and 1 xp virtual machines.

    I have added a printer(not a physical print device) to the server 2003 machine which does have the print manager feature installed.

    I can apply group policies to the workstation all right and the login script does assign the mapped networked drives but does not seem to assign the printer!
    I am using the unc path in the login script \\dc\printers name in the script which is a simple batch file.

    When I enter this path from the run bar on the XP client myself it successfully connects and the printer so the path is correct but it does not work when the script tries to do the exact same thing.

    I have placed a pause command at the end of my script so on the client side I get one message at the top stating

    “CMD.exe was started with the above path as the as the current directory (which is the \user\scripts logon path ) UNC paths are not supported. Defaulting to windows directory.”

    Net use y: \\dc\accounts (this shared folder is correctly mapped)
    Net use \\dc\printer name (it says the command has completed successfully but no printer appears in the clients start\printers folder!

    I have added the pushprinterconnections.exe file to the top of the .bat and also have copied this pushprinterconnections.exe file into the user\scripts\login folder for the OU’s group policy and moved it to the top of the heap etc.

    Also I have used the print manager and used it to deploy the printer to the relevant OU and this is displayed correctly in the deployed printers mmc.

    I have followed every guide out there but no printer is being pushed to this client.

    Can anybody there feel my pain and help

    Reply With Quote Quote  

  2. SS
  3. Senior Member xenodamus's Avatar
    Join Date
    Feb 2010
    Jackson, MS
    I'm not totally sure what's going wrong in your method, but I can tell you what we do. It's pretty simple.

    For each printer, we create a global group.

    If you want a user to have that printer, add them to the group.

    Run this VBScript at login via GPO and if they are in "X" group they will get "X" printer. If they are in "Y" group, they will get "Y" printer. Here's what the script looks like:

    On Error Resume Next
    Set WSHShell = CreateObject("WScript.Shell")
    Set WSHNetwork = CreateObject("WScript.Network")
    Set objDomain = getObject("ldap://rootDse")
    DomainString = objDomain.Get("dnsHostName")
    UserString = WSHNetwork.UserName
    Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)

    For Each GroupObj In UserObj.Groups
    Select Case GroupObj.Name
    'Check for group memberships and take needed action
    Case "ICU",True
    WSHNetwork.AddWindowsPrinterConnection "\\ntuser2x\nicep16"
    WshNetwork.SetDefaultPrinter "\\Ntuser2X\nicep16"
    Case "cds",True
    WSHNetwork.AddWindowsPrinterConnection "\\ntuser2x\cdsp1"
    WshNetwork.SetDefaultPrinter "\\Ntuser2X\cdsp1"

    In the script above, ICU and CDS are groups that install the printers NICEP16 and CDSP1.

    You should be able to copy and paste that with your group/printer names and roll with it if you want. The great part about it is that you can use one script for the entire organization. Just add all the groups and printers in there. Group names are case sensitive btw.
    Last edited by xenodamus; 03-18-2011 at 09:48 PM.
    Reply With Quote Quote  

  4. DoWork
    Join Date
    Jun 2010
    A major Illinois hospital system near you

    Reply With Quote Quote  

+ Reply to Thread

Social Networking & Bookmarks