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 = "\\server\rintername"
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.
This tip is for all versions of Windows, Windows NT and up.
One of my favorite built in tools in Windows is Wbemtest.exe. It is not the prettiest program ever created, but the power to find out information on your computer and other computers on the network is second to none. This tool should be in the tool belt of any administrator that does SCCM, SMS, VBScript, PowerShell or anyone who wants to know more about the settings of their, or other, computers.
One fun thing to do with Wbemtest.exe is just browse the WMI classes to see what type of information you can see about a computer. To do this, start Wbemtest.exe and click the Connect button. For most cases you will leave the Namespace, if the computer you are on has another Namespace set, change it to root\cimv2. You can also enter credentials other than your current credentials, or connect to remote computers by changing the Namespace to \\computername\root\cimv2.
To view all of the classes available in the cimv2 namespace select Recursive and click OK.
Depending on the OS version you will have from a few hundred classes to > 1000 classes. Scroll down and double click the Win32_ComputerSystem class.
This is the Win32_ComputerSystem class definition, to view the actual data of your computer click the Instances button.
Double click the result.
The Object editor window has the class and the actual data for your computer, or if you connected to a remote computer, the remote computer’s data.
If you know the WMI class of the object, you can use the Query button to run a WQL query that returns just the information you want.
This query will return an instance of the Win32_ComputerSystem class for the computer THECHADLAPTOP.
Wbemtest is very useful for creating VB and PowerShell scripts, for finding information on a Windows Server Core server, creating Group Policy WMI filters in Active Directory and much more.
Have you ever used Wbemtest? If so, what have you use it for?
For more details on Wbemtest.exe see this article from the Scripting Eye for the GUI Guy; http://technet.microsoft.com/en-us/library/ee692770.aspx.
This tip is for Windows Vista, 2008 Server RTM and up.
Since I talked about Wbemtest.exe and Windows System Stability Index in the last posts I thought I would do something useful with the treasure trove of reliability information available through WMI. Usually the System Stability Index is shown in the Windows Reliability History by a graph that shows the index by day. One small issue though is that there are only 3 graduations (1, 5 and 10) on the chart to shown what the index is. Below is a fun little PowerShell script that will display a single reliability score basedon an average all of the Windows System Stability Index scores. This way, you can easily where the computer is at, from 1 lowest to 10, perfect reliability.
To run the script either copy the text in yellow below and paste into Notepad and save as a .ps1 file or copy the text in yellow below and paste into the PowerShell ISE in Windows and run from there.
$avg=0 $count=0 $total=0 $query = "select TimeGenerated,SystemStabilityIndex from Win32_ReliabilityStabilityMetrics" $wmiobj = get-wmiobject -query $query foreach ($rel in $wmiobj) { $total=$total+$rel.SystemStabilityIndex $count=$count+1 } $avg = $total/$count Write-Host "This computer has an all-time reliability of" $avg "out of 10.0"
Those of you following, my home built machine has much better reliability than my laptop. 9.3 is very high. Anything less than 5 I would look to reimage and go through the hardware to see if there was a bad component like disk or memory (RAM).
What are your scores?
How reliable is a computer? Most of the time if you ask this question, you will get a subjective answer; depending on the how the day is going of the person you posed the question to. If you are a support professional and have been for any amount of time, you will know first of all, you NEVER ask this question to your user.
There are many reasons though, for wanting to know more about the real reliability of a machine. You may be in the middle of a refresh and need to know what machines need to be replaced, your warranties may be expiring and you want to track down any computers that should be fixed before the warranty expires. You might also want to verify that the computer is a piece of **** per what the user is telling you. How do you verify this? You could go through the Windows Event Logs in Event Viewer and track down critical, error and warning events; correlate them with times that the user was having issues. Then try to figure out if the amount of errors are normal or above normal. You could just take their word for it and find them a new computer. If the computer is running Windows Vista or above, you could also use the Windows Stability Index to quickly gauge the overall reliability of the machine. More information can be found about Reliability Monitor in the following links.
Windows Vista Reliability Monitor
Windows 7 Reliability Monitor
Start Reliability Monitor in Windows 7 by going to Start->Control Panel->System and Security->Action Center->Maintenance->View reliability history, or right-click on the white flag in the system tray in the taskbar and Open Action Center-> Maintenance->View reliability history. You can also use the search box in the Start Menu and start typing reli…, you should have View reliability history in the search results.
Here is the current reliability of my computer.
Ah oh.
Looks like my computer was working fine up until February 24, then not so well for the next 2 weeks. The Reliability Index is a number from 1 to 10, 1 being the worst and 10 the best. Right now my computer is about a 5.9. Not good, so what do I do now? When a computer was working fine for a while and then started crashing, I look at the informational events the day of the first crash and the days before to see what changed. Usually something was changed, like a new driver was installed, or a new update, or new hardware. In my case I have looked and the only changes at the first crash was virus definition updates. So in my case the mystery is still on, for now I am blaming them on the sunspots.
If I did think that my computer’s issues were related to the software load I could update all of my drivers, if that didn’t help, I could save my reliability history to an XML file and then reload Windows, afterwards I could compare the results. If the score is still bad, then start looking at the hardware. You can also use the actions next to the errors and warnings to check for a solution, or view the details of the crash. At least if I called you for support, you could look at my score and see that I was not exaggerating, my computer really is a piece of ****. ;)