Category Archives: Computer Support

Check Uptime of Domain Computers

Recently we pushed some updates through GPO which ran at a users login to the domain. Weeks went by and I kept getting calls about people with old software that didn’t update. After some quick investigating these users were simply not rebooting or shutting down their computers and some were going on two months. On one hand that’s pretty good for Windows 10 machines but on the other they were missing important updates. After looking around I found that PsInfo.exe, part of the PSTools suite, would let me poll a computer for uptime but I wanted to poll all the computers and see how widespread this problem was.

First I started with a list of all computers taken from Active Directory using this PowerShell command to export them to a text file. Technically this command exports to a csv but I’m only taking one column so I skipped a step:

Get-ADComputer -Filter * -Properties Name | Select-Object Name | Export-CSV "C:\temp\ComputerNames.txt" -NoTypeInformation

Opening the file you should have a header of Name with all your workstations. I deleted the header and did a global find and replace to remove the quotes so I had a file with just the workstation names. Next I made a batch file with this single line:

For /f "tokens=*" %%i in (ComputerNames.txt) do psinfo uptime -nobanner \\%%i >> uptime.txt

I placed the batch file (CheckUptime.bat for me) in the same directory as PsInfo.exe and my ComputerNames.txt file. Run the batch file and it will step through each computer name in the file and check the uptime giving you something like this:

System information for \WSComputer2:
Uptime: 0 days 5 hours 24 minutes 57 seconds
System information for \WSComputer6:
Uptime: 2 days 17 hours 45 minutes 18 seconds
System information for \WSComputer23:
Uptime: 0 days 0 hours 42 minutes 41 seconds

I’m sure there is also a way to scrap the file and clean this up but it works for my needs.

Windows 7 Printer and Spooler Issues 0x00005c3

During my many years troubleshooting computers nothing seems to be as frustrating as printing issues. Granted it has gotten much better but that just means when you do have a issue it’s going to be that much harder to fix. Today I had such a issue. I upgraded the drivers for some network printers ahead of a printer change-out, updating some Lexmark, Konica, and HP Universal print drivers to their respective latest versions. Windows 7 usually is good about grabbing the updated drivers form the server and rarely will anyone see any issues. Well during my testing I had installed and uninstalled the Konica universal drivers multiple times and apparently something got corrupt. When trying to install the new printer I got a error saying Cannot connect to Printer along with a 0x000005b3 code. I did a bunch of research and couldn’t find anything that helped. Some posts said delete your temp files, some said look for *.tmp files within the Windows System32 directory and delete those. Others said try running a Microsoft Fit It for the print spooler (50984 for easy fix and 50979 for full fix resetting everything and deleting all your printers). None of these worked.

Then a post said to check your Windows\INF folder and the setupapi.app.log file for clues. I renamed the file then tried installing the printer again and it created a new log file just with info from the failure. It referenced a bunch of missing files from the Windows\System32\DriverStore\FileRepository directory on the computer. So I though well I can just delete those files and it should download fresh. Unfortunately I couldn’t delete the directory. So now I did a search on how to delete files from the DriverCache and found this article: https://technet.microsoft.com/en-us/library/cc730875.aspx?f=255&MSPPError=-2147217396

Long story short the utility pnputil.exe is used from a administrator command prompt to list all the driver packages cached/installed on your machine. pnputil.exe -e lists all the OEM?? numbers and gives a description of what they are. I ran it and looked through the list and found three different Konica drivers listed. I then ran pnputil.exe -d Oem??.inf for each of the three and it deleted the drivers. I checked the FileRepository directly and the directory in question was gone.

I then tried re-adding the network printer and it worked, connected and downloaded the drivers off the server without issue, and has been working since. So if you are getting the 0x00005c3 error try deleting all printers using the same driver then using the pnputil to delete out an drivers cached and then reinstall. Might save you from re-imaging or reinstalling your OS which many people ended up doing when they couldn’t figure it out.