deploy printers to users in an OU using a GPO

March 18, 2011 at 08:48:27
Specs: server 2003 / xp
Good morrow all

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 and shows that a printer is indeed deployed to the OU. I have assigned full share and ntfs permissions to the printer object.

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

Can anybody there feel my pain and help



See More: deploy printers to users in an OU using a GPO

Report •

March 18, 2011 at 10:27:55
There is like 3 ways to do it and I tried them all and this method seemed to work the best for me...

RunDll32.EXE printui.dll,PrintUIEntry /in /n "\\\TOSHIBA Color Copier (Back)"

It will install the printer driver and map the connection for you. I had a little bit of a problem with this tecnique because my Print Server is running 2008 server 64bit and I could not install 32bit drivers on 2008 because they remove the NTPRINTER when you install 32bit and you have to exstract it from the CAB file so you can install the 32bit drivers. Don't know if you ever exstracted any thing from a Windows CAB file before but it is a pain. Sorry had to rant a little about Microsoft. So any ways try the above method and see if it works for you. The other method besides the NETUSE is done in VBS but VBS is slow because the virus scanner will not allow the VBS to run untill after it scans it. If you want to try the VBS method here you go...

Option Explicit
On Error Resume Next

Dim objNetwork, strPort, strUNCPrinter, strPrnDrv

strPort = LPT2 'For DOS printers.
strUNCPrinter = "\\\TOSHIBA Color Copier (Back)"

Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strUNCPrinter
objNetwork.AddPrinterConnection strPort,strUNCPrinter


Hope this helps you with alternative ways to map printers.

Report •

March 18, 2011 at 14:26:37
Thanks omega

Its hard not to rant at MS when a what should be simple matter of mapping a printer to a client has caused me 2 days of grief with no results.

I have tried the solution above

RunDll32.exe printui.dll,PrintUIEntry /in /n "\\\TOSHIBA Color Copier (Back)"

and i have replaced the ip with that of the my server and the printer name with the one used on my server but no dice. I added an extra line identically but with the ip for the client.

I have copied the rundll32.exe to the logon policy folder and to the root drive.

Is there anything else I need to do??

Im new to scripting so this 1st task is a nightmare.

Report •

March 18, 2011 at 14:35:52
"Is there anything else I need to do??"

You have to install drivers on the print server that are supported by the different types of OSs on your network. I think you have to also go into the GPOs and give the users the ability to install printers.

User Configuration\Administrative Templates\Control Panel\Printers\Prevent Addition of Printers -> Set it to disabled.

I think I am missing something, I can't remember because I set this up months ago.

These might help...

Good Luck.

Report •

Related Solutions

March 19, 2011 at 04:33:28

I reebooted the server and workstation and now the script works beautifully for 1 OU but not for the othe where it states

"the procedure entry point could wow64enable wow redirection could not be located in the dll kernal32.dll !!.

I did apply the group policy disbling the prohibition of users adding printers.

but at least i got it working on one OU which should carve a big chunk of my trouble shooting.

Thank God. now i can get a full nights sleep. You have saved me many hours of frustration Omega and you have my eternal gratitude.

again thanks mate :)

Report •

March 21, 2011 at 08:19:57
That error is one of two things. One, you do not have an up-to-date driver for your printer or two, your workstation is running SP1.

Report •

Ask Question