Windows 2000, XP, 2003, Vista, and 2008 have the capability to have a Network Printer so that it is automatically available to any user that logs on at that computer. Unfortunately, the Add Printer wizard does not expose that capability - it can only add a Network Printer for the currently logged on user. So to add a printer globally (for all users) you have to a different tool.
The PrintUIEntry function of printui.dll has options for performing most printer management functions. It can perform these functions either on the same computer that printui.dll is running on or on another computer (i.e remotely). The general purpose rundll32 command can be used to execute PrintUIEntry function of printui.dll.
Some things to keep in mind:
- The function for adding a printer globally is /ga. Globally in this context means that the action applies to all and any users that happen to logon at the target computer.
- The corresponding function for deleting a printer globally is /gd. If you attempt to delete a global printer by using the Delete function in the printer's context menu, it will appear to delete, but will reappear when the Print Spooler service is restarted.
- Only printers previously added using the /ga function can be deleted using /gd.
- You have to have administrative rights and permissions on the target computer to use these functions.
- If a printer is added remotely using the /ga function, it will not appear to the user until the Print Spooler service is restarted or the user next logs on. You can restart the print spooler remotely using these commands:
sc \\targetcomputername stop spooler
sc \\targetcomputername start spooler
Like any other commands these commands can be used inside a command file, such as addglobalprinterremotely (see below).
Here's a way of "installing" network printers on workstations so that they are available to all users (remotely).
The file at AddGlobalPrinterRemotely.cmd has the commands for adding a network printer remotely and restarting the print spooler on the target computer.
If you prefer not to download .cmd files, paste (or key) the following into your own .cmd file (e.g. AddGlobalPrinterRemotely.cmd)
rundll32 printui.dll,PrintUIEntry /ga /c\\%1 /n\\%2
start /wait sc \\%1 stop spooler
start /wait sc \\%1 start spooler
Then, at a command prompt key:
addglobalprinterremotely targetcomputername printservername\printersharename
For example to install the printer \\pserver\p1 on the workstation abc:
addglobalprinterremotely abc pserver\p1
To find out more about the rundll32 printui.dll,PrintUIEntry command, key (case sensitive):
rundll32 printui.dll,PrintUIEntry /?
Here's some details:
/c specifies the computer which is to be the target of the requested action.
If /c is not specified, the local computer is assumed. In other words, the /c option allows you to do printer management things on other computers without actually physically being there (i.e. remotely).
/n specifies which network printer is to be, in this case, added using the printer's UNC name (\\servername\printersharename).
/? is understood by PrintUIEntry to be a request for its Help information, which is displayed in a separate window.
The "start /wait" command runs the command (e.g. sc), then waits until the command actually terminates. Stopping and starting the print spooler takes a while, so without this, the next command (e.g. sc ... start spooler) may run before the spooler is actually stopped.
Note : Possibly useful links
http://www.coribright.com/Windows/ some how to do things with printers articles
http://www.practicallynetworked.com/sharing/xp/addxp.htm help on setting up networks
http://h10025.www1.hp.com/ewfrf/wc/genericDocument?lc=en&cc=us&docname=bpl13043
useful information about printing in mixed OS version environments (NT 4, 2000, XP etc.)
http://welcome.hp.com/country/us/eng/software_drivers.html place to get HP printer drivers
http://www.lexmark.com/lexmark/sequentialem/home/0,6959,204816596_652569478_0_en,00.html place to get Lexmark printer drivers
http://www.epson.com/cgi-bin/Store/index.jsp?cookies=no place to get Epson printer drivers
http://www.usa.canon.com/html/cprSupportDetail.jsp?minisite=10000&a=b&navfrom=DrivD place to get Canon drivers
Bruce's General Windows Pages
http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/management/gp/default.mspx links to Group Policy related documents
http://support.microsoft.com/?kbid=128345 HOW TO: Troubleshoot Printing Problems in Windows 95, Windows 98, and Windows Millennium Edition
http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=bpj02738&locale=en_US&taskId=135&prodSeriesId=27905&prodTypeId=18972 HP Jetdirect Print Servers -How to Determine, Reset, and Configure an IP Address on an HP Jetdirect Print Server
http://support.microsoft.com/kb/555381/en-us How to configure Windows Server 2003 SP1 firewall for a Domain Controller