PowerShell configures the printer through the COM object
(1) list printers
Get-WmiObject-Class Win32_Printer-ComputerName (New-Object-ComObject WScript.Network) EnumPrinterConnections ()
(2) add printers
(New-Object-ComObject WScript.Network) .AddWindowsPrinterConnection ("\\ Printserver01\ Xerox5")
Set the default printer
(Get-WmiObject-ComputerName. -Class Win32_Printer-Filter "Name='HP LaserJet 5Si'") .SetDefaultPrinter () (New-Object-ComObject WScript.Network) .SetDefaultPrinter ('HP LaserJet 5Si')
(3) Delete printers
(New-Object-ComObject WScript.Network) .RemovePrinterConnection ("\\ Printserver01\ Xerox5")
You can also follow the official Wechat account below for more information.