To create a correctly formatted Printer GPP, follow the below guidelines.
Based on experience, it is highly recommended to deploy network printers from Print Management on the print server via Group Policy. That being said, there is scenarios where GPP can and should be used to deploy printers. This script removes removes a few nuisance printers, but can be updated to deploy local or port computer based printers if there is a requirement. It is likely not worth the effort to deploy unique printers with this script, but it can be done.
Computer Printer GPP
Local Printers
$XMLItemAttributes = ("clsid","disabled","name","status","image","changed","uid","bypassErrors","desc","removePolicy","PRIMARYEND","action","name","port","path","default","location","comment","RUNONCE","SUBEND")
Port Printers
$XMLItemAttributes = ("clsid","disabled","name","status","image","changed","uid","bypassErrors","desc","removePolicy","PRIMARYEND","ipAddress","action","location","localName","comment","default","skipLocal","useDNS","useIPv6","path","deleteAll","lprQueue","snmpCommunity","protocol","portNumber","doubleSpool","snmpEnabled","snmpDevIndex","RUNONCE","SUBEND")
User Printer GPP
Code only provided for computer based management of GPP printers.
$XMLItemAttributes values
clsid - This is the clsid of the GPP local and port printer items. GPP clsid Reference
disabled - Enabled
or Disabled
. Icon color is indicating the action taken when pressed. On an enabled GPP it is red and on a disabled GPP is green.
name - Name of the GPP item.
status - A field that is updated when the value of the GPP is updated. Can be the same text as name or value.
image - This is the image that is shown in the Group Policy GUI. Image Reference
changed - Date the GPP is set. $DateUni = (Get-Date -Format u).TrimEnd('Z').
uid - Generate GUID. $GUID = ([guid]::NewGuid()).ToString().ToUpper().
bypassErrors - Sets the Stop processing items in this extension is an error occurs. Value of 1 is unchecked, value of 0 is checked.
desc Set's the Description text. By default includes the $FirmName and $Date. Useful to add additional notes about what the setting actually controls.
removePolicy - Sets the Remove this item when it is no longer applied. Value of 1 is checked, value of 0 is unchecked. Only works with Replace action.
PRIMARYEND - Internal script header to indicate XML subnode.


action - Identifies the action for the GPP.
| Action | Value |
|---|---|
| Create | C |
| Replace | R |
| Update | U |
| Delete | D |


ipAddress - IP address of the printer.
action - Identifies the action for the GPP.
| Action | Value |
|---|---|
| Create | C |
| Replace | R |
| Update | U |
| Delete | D |
Printer GPP Example
See Deployment for instructions on updating GPP.
$XMLItemValues += @($LocalPrinterCLSID,"1","Fax","","3",$DateUni,$GUID,"1","Created By $FirmName on $Date. Removes the Send to Fax Printer.","0","PRIMARYEND","D","Fax","","","0","0","","","Yes","SUBEND")
This line deletes the built in Fax printer.