cajx
asked on
Remove Deployed Printers After Server Died
We have a couple of printers still being mapped to users. They show up under the relevant GPO under:
User Configuration - policies - windows settings - Printer Connections
I do not see a way to manually remove things there, though. Under Group Policy Management, if I edit the GPO, that last part of the path "Printer Connections" does not exist. I can only see this under the Settings tab when I do not edit.
I need to remove these printers that were deployed using Printer Management on a Windows 2008R2 server. How to do so?
User Configuration - policies - windows settings - Printer Connections
I do not see a way to manually remove things there, though. Under Group Policy Management, if I edit the GPO, that last part of the path "Printer Connections" does not exist. I can only see this under the Settings tab when I do not edit.
I need to remove these printers that were deployed using Printer Management on a Windows 2008R2 server. How to do so?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I can't see a way around it with just a GPO. You'll have to use a script like the following.
' Remove all network printers
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Network = TRUE")
For Each objPrinter in colInstalledPrinters
objPrinter.Delete_
Next
Option 2:
' Remove Printers by name
Set objNetwork = WScript.CreateObject("WScr ipt.Networ k")
objNetwork.RemovePrinterCo nnection "\\PrintServer\xerox3006"
(Taken from: http://community.spiceworks.com/topic/91967-batch-script-to-uninstall-printers)
' Remove all network printers
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Network = TRUE")
For Each objPrinter in colInstalledPrinters
objPrinter.Delete_
Next
Option 2:
' Remove Printers by name
Set objNetwork = WScript.CreateObject("WScr
objNetwork.RemovePrinterCo
(Taken from: http://community.spiceworks.com/topic/91967-batch-script-to-uninstall-printers)
ASKER
OK. I'd be tempted to remove them with the script by name, but then they are still going to show up in this GPO. I guess if there is no way to edit the GPO, I am forced to kill it.
I keep seeing people speak well of pushing printers out in the GPO under the area of:
Preferences - Control Panel - Printers
Never have I tried that before, but now I see a good reason to do so. It seems like you have much more control in the event of a server disappearing.
Thanks for the help!
I keep seeing people speak well of pushing printers out in the GPO under the area of:
Preferences - Control Panel - Printers
Never have I tried that before, but now I see a good reason to do so. It seems like you have much more control in the event of a server disappearing.
Thanks for the help!
My pleasure. Glad to help.
ASKER