Problem Description :

Various types of error messages can occur if a client tries to print in a Terminal Server session or remotely in Windows Server 2003, 2008 and 2012.

If a client tries to print from Word, Excel, Power Point, Notepad or Adobe Acrobat Reader in a Terminal Server Session, Citrix Session or remotely the below error messages can occur.

“Current printer is unavailable. Select another printer”
“No default printer selected”
“Insufficient memory”
We saw that these various type of error messages are mostly related to the following printer drivers : Kyocera, Minolta, Brother, Samsung and HP.

Impact :

If this problem occurs the client cannot print and should select another printer.
Sometimes printing a test page allows the client to print to the prefered print queue again.

Solution :

× If you found this article useful and would like to appreciate, you can share it on LinkedIn as a thanks !

After several tests and analysis we found out that the DevModePerUser and/or DevModes2 problem was the reason of these various types of error messages.

Basically DevModePerUser and/or DevMode2 registry entries could not be updated or could not be set properly and caused to these error messages.

HKEY_CURRENT_USER\Printers\DevModePerUser
HKEY_CURRENT_USER\Printers\DevModes2

Removing the affected Print Queue Connections manually or via Script (printui.dll) from the registry key below and mapping the Print Queues again via Point and Print or via Script has solved the problem in our case .

HKEY_CURRENT_USER\Printers\Connections\DeleteAffectedPrintQueue

Delete_effected_print_queue

Automation :

We have created a batch job (*.BAT) for our customer because hundreds of users were affected from this problem and bound it as logon script which deletes and maps the print queues again.

rundll32 printui.dll PrintUIEntry /dn /n\\machine\printer
@ping 127.0.0.1 -n 60 -w 1000> nul
rundll32 printui.dll PrintUIEntry /in /n\\machine\printer

Additional Explanation :

By default "HKEY_CURRENT_USER\Printers" is empty.

HKEY_CURRENT_USER_Printers

Once we connect to a shared Network Printer, in this example “HPColorLaser” the following Registry KEY at the second screenshot below is added to the Connections.

Shared_Printer

"HKEY_CURRENT_USER\Printers\Connections\,,192.168.2.5,HP Color Laser Jet" is added to the "Connections" as an example via Point and Print.

Printer_Connection

rundll32 printui.dll PrintUIEntry /dn /n\\192.168.2.5\HPColorLaser <- Note : Please use the Printer Share Name to delete the Connection from the registry of the affected user or users. You can of course delete the connection manually if only a few users are affected. rundll32 printui.dll is only required if you have too many users which are affected and you need to automate it.

printui_delete

@ping 127.0.0.1 -n 60 -w 1000> nul <- Note : We have added the ping localhost of 60 seconds because we figured out that on some clients it took some time to delete the connection therefore we let the script wait 60 seconds prior to mapping the queue again.

rundll32 printui.dll PrintUIEntry /in /n\\192.168.2.5\HPColorLaser <- Note : Once we run printui.dll with the /in parameter the connection is added again.

printui_re_create_connection

Additional Useful Articles :

How to troubleshoot Windows 7 SP1 Update stuck at “Checking for updates …” .
http://www.kuskaya.info/2016/08/21/how-to-troubleshoot-windows-7-sp1-update-stuck-at-checking-for-updates/

Printers can disappear in (PMC) Print Management Console on Windows 8.1 or Windows Server 2012 R2 after May, June, July, August 2016 Updates
http://www.kuskaya.info/2016/08/26/printers-can-disappear-in-pmc-print-management-console-on-windows-8-1-or-windows-server-2012-r2-after-may-june-july-august-2016-updates/

Good luck !