Created
July 31, 2015 05:47
-
-
Save poshcodebear/d868f5aa1debc1197009 to your computer and use it in GitHub Desktop.
Bulk removing printers using WMI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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