Skip to content

Instantly share code, notes, and snippets.

@poshcodebear
Created July 31, 2015 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poshcodebear/d868f5aa1debc1197009 to your computer and use it in GitHub Desktop.
Save poshcodebear/d868f5aa1debc1197009 to your computer and use it in GitHub Desktop.
Bulk removing printers using WMI
$printserver = "\\\\PrintServer-01\\"
$printers = Get-WmiObject Win32_Printer -Filter "Name LIKE '%$($printserver)%'"
foreach ($printer in $printers) {
$printer.PSBase.Delete()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment