![Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/733/36700733/b_36700733.jpg)
上QQ阅读APP看书,第一时间看更新
How to do it...
- Install the Print-Server feature on PSRV, along with the print management tools:
Install-WindowsFeature -Name Print-Server, RSAT-Print-Services
- Add a PrinterPort for a new printer:
Add-PrinterPort -Name Sales_Color ` -PrinterHostAddress 10.10.10.61
- Add a PrinterDriver for this printer server:
Add-PrinterDriver -Name
'NEC Color MultiWriter Class Driver' -PrinterEnvironment 'Windows x64'
- Add the printer:
Add-Printer -Name SGCP1 ` -DriverName 'NEC Color MultiWriter
Class Driver' ` -Portname 'Sales_Color'
- Share the printer:
Set-Printer -Name SGCP1 -Shared $True
- Review what you have done:
Get-PrinterPort -Name SGCP1 | Format-Table -Property Name, Description, PrinterHostAddress, PortNumber
-Autosize Get-PrinterDriver -Name NEC* | Format-Table -Property Name, Manufacturer, DriverVersion, PrinterEnvironment Get-Printer -ComputerName PSRV -Name SGCP1 | Format-Table -Property Name, ComputerName,
Type, PortName, Location, Shared