- Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
- Thomas Lee
- 102字
- 2021-07-02 18:15:57
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:

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:

As you can see, you have now published the printer and set the location to the 10th floor, area 10E4.