Setting Default Printer FOR THE System User in Windows Server 2012

windows-server-2012

Is there a way to set the default printer for the SYSTEM USER?

Or, alternatively is there a way to set the default printer for ALL users of the server?

I am a C# \ SQL Server Developer by trade, so this stuff is beyond me a bit, and GOOGLE hasn't been of much use. ( all old as dirt posts, nothing specific to 2012 )

Basic Use Case:

If I log in as a standard user, I can look at the list of printers and then right click on one of the printers and set it as my default.

Rather than doing that for each user on the server, is there a way to set the default printer for all users?

Or – specifically is there a way to set the default printer for the SYSTEM account?

Best Answer

To set default printer for users logging on workstations or servers, you can use the following:

  1. Group Policy if you have AD domain
  2. User logon scripts as an alternative to #1

n.2 works in case of a stand-alone server too (without AD domain)

In case SYSTEM user you could use the same logon script. Just run it from SYSTEM account (e.g. via Task Manager or custom service).

Here is how you add default printer via VBScript:

Dim objNetwork, strUNCPrinter
strUNCPrinter = "\\printserver\HP LaserJet 1100"
Set objNetwork = CreateObject("WScript.Network") 
objNetwork.AddWindowsPrinterConnection strUNCPrinter
objNetwork.SetDefaultPrinter strUNCPrinter

Save this to *.vbs file and run using cscript.exe scriptfile.vbs

Note: There are tons of samples on the web for adding printers using other scripting languages, if you prefer PowerShell or JScript