Artur Tyksinski - Sysadmin Blog

Artur Tyksinski - Sysadmin Blog


System Administration Blog by Artur Tyksinski. I talk about anything and everything technology. Mostly Virtualization, MSP, Cyber Security and Linux.

Share


Tags


avrt

Windows Server GPO Default Printer

Setting a default network printer via Group Policy can get cumbersome. Under User Configuration > Preferences > Control Panel Settings > Printers, you can deploy a new shared printer and set it to 'Create' as well as be the default printer.

Artur TyksinskiArtur Tyksinski

Setting a default network printer via Group Policy can get cumbersome. Under User Configuration > Preferences > Control Panel Settings > Printers, you can deploy a new shared printer and set it to 'Create' as well as be the default printer. You will, however, run into issues if the printer is already deployed on the server you are attempting to change the default printer on. You will also run into issues if the printer is set to 'Create' in the GPO because Windows will run the two tasks consecutively and fail. By the time Windows finishes creating/adding the printer to the server, the task to set it as the default will already fail. You can save yourself some time and sanity by just doing a seperate GPO that modifies the registry for the users and sets the default printer for them.

In order to determine the right path/value for you to use in the group policy registry window, you should log in as a user to a server that is joined to the domain and has the default printer you want to set as default for other users. Open up control panel and set your default printer to match what you want the default printer to be for the other users if this is not the case currently.

Once this has been done: open up registry editor on the same server (hold down windows key and press R to open Run Dialog and then type in regedit and hit OK).

In the registry editor, head to Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows and look at the 'Device' REG_SZ value. You should see something similar to the below screenshot:

The string responsible for displaying the currently set default printer for the currently logged in user.

You need to copy and save the entire Value data that you see under this String somewhere. You will need it for the next step.

On the active directory server, open up Group Policy Management

Go to Forest > Domains > corp.domain.tld > Your Users OU and right click and create a new GPO (Create a GPO in this domain, and Link it here...)

In the group policy management editor, navigate to User Configuration > Windows Settings > Registry

Right click in the Registry window and select 'New > Registry Item'

Change the action to Update, set the Hive to HKEY_CURRENT_USER

In the key path field, enter SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows

For the value name field, simply enter Device (default checkbox should be unchecked, and yes, literally just Device)

Set value type to REG_SZ

Set the Value data to what you found earlier, in my case it is Canon,winspool,Ne05:

Your window should now look similar to the one below:

You can now go to the 'Common' tab and apply Item-level targeting if necessary. Item-level targeting lets you target this change so that it only applies to specific users or user groups. If you do not need this, you can simply hit OK.

Close out of the rest of the dialog boxes.

You can now run the gpupdate command on the AD and then run it on any servers that will be affected by this change.

Any time a user logs in, their default printer will be updated to the device you defined in the registry path (in that last screenshot above) without hassles.

View Comments