How can I modify this PS script to delete local printers instead of network printers?


i found following script need opposite , delete local printers instead command delete printer doesn't start '\\'.  please advise if know how.  thanks!

$printers = get-wmiobject -class win32_printer

foreach ($printer in $printers)

{

#remove network printers

if($printer.name -ne $null -and $printer.name.startswith(“\\”))

{

$printer.delete()

}

}

sorry not fix or rewrite scripts found on network.

if not scripter find in company help.

you can use printer scripts found here "c:\windows\system32\printing_admin_scripts\en-us" manage local printers.

for more assistance no-technical users post in windows printing or windows general forum.

you can find dozens of scripts in gallery.


\_(ツ)_/



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

some help on Event 540

WMI Repository 4GB limit - Win 2003 Ent Question

Event ID 1302 (error 1307) DFS replication service encountered an error while writing to the debug log file