Freigeben über


How to delete all the printers for all the users.

This was the scenario on which i was working the other day, all the users had mapped printers in their organizations manually over the period of time until it become too chaotic to be managed.  So when we decided to map the printers finally with the GPO but the need arise to clean up all the other stale printers that user has mapped. So this is something we pushed with the users as logon script. this deleted all the printers for the users, Additionally we did a gpupdate in our script to make sure the user also get the printer we have mapped from the GPO.

$Printers=Get-Printer |Select-Object -Property name

$PrinterName=$Printers.name

foreach($i in $PrinterName)

{

remove-printer -name $i

}

Comments

  • Anonymous
    October 31, 2016
    Why not just use:Get-Printer | Remove-Printer