Automate Group Policy Preferences printer-management using Windows PowerShell

Ive written a couple of blog posts earlier on Group Policy Preferences and printer deployment using Group Policy.

Using Group Policy Preferences is a very flexible way to deploy printer connections. This is also very manageable in smaller environments. What if you got hundreds, or even thousands of printer connections you need to deploy? Do you want to sit down and make several thousands of mouse clicks to accomplish the task? There are better alternatives!

Based on SDM Softwares Group Policy Automation Engine, Ive created a script module to handle this. The script module are available from this link.

Save the script module as a psm1-file in the following directory: %userprofile%DocumentsWindowsPowerShellModulesGPPreferencesPrinters
You need to manually create the 3 subfolders under %userprofile%Documents if they doesn
t exist.

When done, start Windows PowerShell and type the following command:

image

You should now see the GPPreferencesPrinters module.
Import the module with the Import-Module cmdlet:

image

As you can see there are two functions in addition to SDM Software`s cmdlet: Add-GPPreferencesPrinter and Get-GPPreferencesPrinter.

Example 1:

image

Example 2:

If you got the printers listed in an Excel spreadsheet, save the document in csv-format:

image

The csv-file may be used like this to import the printer connections:

image

image

Additional functions and parameters will later be added to the script module, i.e. Remove-GPPreferencesPrinter and Item-Level Targeting. Note that example usage for Item-Level Targeting are provided in the Group Policy Automation Engine User Manual.

6 thoughts on “Automate Group Policy Preferences printer-management using Windows PowerShell

  1. Pingback: Group Policy Center » Blog Archive » Automate Group Policy Preferences printer-management using Windows PowerShell

  2. Have you yet modified this Powershell script so that it can be used to also configure Group Policy Preferences with Targeting to Active Directory Security Groups? In Jan 2010 you mentioned you’ll add Item-Level Targeting. Is there an updated version with this feature? Thank you for your time.

  3. Pingback: Christjan's IT Minutes » Sample scenarios of dynamic printer deployment with Group Policy Preferences

  4. With PS3 in the horizon. Would you find any good reason to not wait for it, and still choose the ‘Group Policy Automation Engine’ from SDM Software wanting to mess with GP Preferences through Powershell?

    • I couldn`t see any new features in the Group Policy module in the Developer Preview of “Windows Server 8″, but I guess we can hope for some new features in the upcoming beta. Until then I still see great value in the SDM GPAE.