- Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
- Thomas Lee
- 141字
- 2021-07-02 18:16:02
How it works...
This recipe is relatively straightforward, with a bit of a twist. In step 1, you set BODP for printer SGBRCP1 using the Set-Printer command.
In step 2, you look into the registry for details about the shared printer. At the time of writing, using the cmdlet Get-Printer does not return the RenderingMode by default. You can either specify the -FULL switch to Get-Printer, or you can get the details from the registry. Using the -FULL switch takes additional time, so it's not done by default-accessing this setting from WMI should be faster. Also, the RenderingMode property is not returned, by default.
In step 3, you use the Get-Printer command, specifying the -Full parameter, to return the following:
Finally, in steps 4 and 5, you reset the value of Branch Office Direct Printing to default, then re-redisplay the value: