Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Replace PRINTSERVER with name of the Print Server
- $PrintServer = "\\PRINTSERVER"
- $Printers = Get-WmiObject -Class Win32_Printer
- ForEach ($Printer in $Printers) {
- If ($Printer.SystemName -like "$PrintServer") {
- (New-Object -ComObject WScript.Network).RemovePrinterConnection($($Printer.Name))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement