**(一)列出打印机** ``` Get-WmiObject -Class Win32_Printer -ComputerName (New-Object -ComObject WScript.Network).EnumPrinterConnections() ``` **(二)添加打印机** ``` (New-Object -ComObject WScript.Network).AddWindowsPrinterConnection("\\Printserver01\Xerox5") ``` **设置默认打印机** ``` (Get-WmiObject -ComputerName . -Class Win32_Printer -Filter "Name='HP LaserJet 5Si'").SetDefaultPrinter() (New-Object -ComObject WScript.Network).SetDefaultPrinter('HP LaserJet 5Si') ``` **(三)删除打印机** ``` (New-Object -ComObject WScript.Network).RemovePrinterConnection("\\Printserver01\Xerox5") ``` 您也可以关注下方微信公众号获取更多资讯 ![](https://s1.51cto.com/images/blog/201905/09/b2d0fe2ce1174a94960751f26ac976ce.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)