Tip 48: Setting Up and Installing Printers in Windows
This tip is for Windows XP SP3, Vista, 7 and possibly 8.
This is going to be a long post, but is not meant to be all inclusive. There are definitely other ways to setup and install printers, but the ways below are a good practice to follow as they do not rely on any registry hacking or trickery to accomplish.
There are two major types of printers in Windows, local printers and remote printers. Local printers are any printers connected via a port. A port can be USB, LPT, COM, FILE, TS and TCP/IP. A port can be installed via software like the XPS port or a PDF port if you have a PDF printer installed. The other type of printer is the network printer. A network printer would be used when you are connecting to a print server/spooler share, or use a Bluetooth/wireless printer.
Desktop administrators often want to setup printers beforehand so the end users do not need to install the printers themselves, which requires finding and installing the correct drivers, knowing whether or not the printer is local or remote; which in some cases depending on the network a printer could be installed as either. Also in most cases the administrators want all users on a particular computer to all have the same printers installed available without any end user interaction. This is where some of the hacks come into play as network printers will be installed per user profile. Local printers are installed machine wide so all users on a computer will be able to use them. This is a good overview of how to install a printer in Windows 7; http://windows.microsoft.com/en-us/windows7/Install-a-printer. Simple so far, but how do you install a network printer for all users; since in some versions of Windows users cannot install local printers Figure 1 and how do you make a specific printer the default printer?
Figure 1
When trying to install a local printer on Windows XP or Windows Vista you will need to be logged in as an administrator. If you are not logged in as an administrator and try to install a local printer in Windows XP, the selection will be greyed out Figure 2.
Figure 2
If you are not logged in as an administrator and try to install a local printer in Windows Vista, you will receive a UAC logon prompt where you will have to provide administrator credentials Figure 3.
Figure 3
Installing a network printer for all users the Group Policy way
If the computer is a member of a domain and you have other computers that need the same printers installed you will most likely want to install the printer using Active Directory Group Policy, which is called deploying a printer. For more information see the following; http://technet.microsoft.com/en-us/library/cc722179(v=WS.10).aspx.
What if you do not have a domain, or you do not want to use it to deploy your printers? You can still use group policy. In Windows Vista and Windows 7 you can use the Local Group Policy to deploy a network printer to all users of a machine. To deploy a printer in Vista/7 run gpedit.msc Figure 4 and open the Computer Configuration->Windows Settings->Deployed Printers. Right-click and Deploy Printer Figure 5.
Figure 4
Figure 5
After clicking on Deploy Printer, enter the location of the printer share and add Figure 6.
Figure 6
When you are done adding network printers, they will be listed in the Local Group Policy Figure 7.
Figure 7
To start using the printers, you must restart the computer, gpupdate.exe will not deploy the printers when the policy refreshes. Afterwards, you will see the printers in the Printer control panel in Windows Vista, or the Devices and Printers control panel in Windows 7 Figure 8.
Figure 8
If you are building an image to deploy, you can sysprep the computer and the Deployed Printers will remain. *If you are using Windows 7 and sysprep after deploying a printer and receive the error “Windows could not finish configuring the system. To attempt to resume configuration, restart the computer.”, then try the following update; http://support.microsoft.com/kb/981542/. *If you deploy printers using Local Group Policy users will not be able to remove the printer using the control panel; they will have to be removed by removing the group policy deployed printer and restarting the computer Figure 9.
Figure 9
Installing a network printer is great if you have permissions to the printer. What if I do have a domain, but my computer is only in a workgroup, can I still install a domain shared printer; or can I share from one computer to the next without having to be logged in with the same account and password?
Yes, you can use the Credential Manager to cache the username and password for a connection to another computer. This works in Windows XP, Vista and 7. For more information on this feature in Windows 7 see the following; http://windows.microsoft.com/en-US/windows7/Store-passwords-certificates-and-other-credentials-for-automatic-logon. In Windows XP see the following; http://support.microsoft.com/kb/306992.
Installing a local printer for all users
Installing a local printer for all users is simple, just install the printer as an administrator in Windows XP and Vista; or as any user in Windows 7 and the printer will be available for all users.
Making a Printer the Default Printer
There are many ways of accomplishing this; I will list them in order from what I think is best to least desirable.
1. Use WMIC to set the default printer, works in Windows XP, Vista and 7.
WMIC printer where name=’\\server\printername’ call setdefaultprinter
2. Use PowerShell to set the default printer, works in Windows XP, Vista and 7. *Will need to install PowerShell in XP and Vista.
$prntr = GWMI -class Win32_Printer | Where {$_.Name -eq “printername“}
$prntr.SetDefaultPrinter()
3. Use VBScript to set the default printer, works in Windows XP, Vista and 7.
Dim oNet, strPrinter
strPrinter = “\serverrintername”
Set oNet = CreateObject(“WScript.Network”)
oNet.SetDefaultPrinter strPrinter
Hopefully this post clears up some of the information that is around about how to configure printers. If you know of other ways, please let me know; like I said, these are not the only ways but I do think they are the cleanest ways to get the job done.