![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=1739580731-tByy2SnKb2DKLUJGJbnylO45g6yYSphB-0-fe51e708825a21fc311572d1e1cdec00)
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=1739580731-OsIp8Zznz869m3HCR2ANvnIGvufrUqGF-0-6d51561da187f9caa4230d0e59c917b5)
As you can see, you have now published the printer and set the location to the 10th floor, area 10E4.