![Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/733/36700733/b_36700733.jpg)
上QQ阅读APP看书,第一时间看更新
How it works...
In step 1, you get the printer details for the Sales Group group's printer, SGCP1, and store it in $Printer. There is no output from this step.
In step 2, you output the printer details to see that you have not yet published the printer:
![](https://epubservercos.yuewen.com/7D2E6F/19470404008937606/epubprivate/OEBPS/Images/f2087a9a-569a-4ff5-99c8-dc515e2b4fbc.png?sign=1739009281-ulrUICnFENVBtxO4bzV6MuvyPwerB5cF-0-822566a5961a6cc052461d17e94933b5)
In step 3, you publish the printer by piping the Printer object to Set-Printer, specifying that you wish to publish the printer. In step 4, you can see the results of publishing the printer:
![](https://epubservercos.yuewen.com/7D2E6F/19470404008937606/epubprivate/OEBPS/Images/f28cc27a-6805-412e-9fe0-f3f090e7afed.png?sign=1739009281-Ed69SfKfGrLjLQTqkunIltqU5TsUw9h5-0-98a8e54cc835a32afdf08a1f968da3dc)
As you can see, you have now published the printer and set the location to the 10th floor, area 10E4.