Windows 8.1和Windows Server 2012 R2引入了一個(gè)組件:“PrintManagement”,它包含了所有用來管理本地和遠(yuǎn)程機(jī)器打印機(jī)的命令。
當(dāng)然,你要運(yùn)行它,得確保調(diào)整變量 $IPAddress 指向真實(shí)存在的打印機(jī)地址。把$ComputerName 從本地機(jī)器名更改為遠(yuǎn)程機(jī)器名。
PS> Get-Command -Module PrintManagement
CommandType Name ModuleName
----------- ---- ----------
Function Add-Printer PrintManagement
Function Add-PrinterDriver PrintManagement
Function Add-PrinterPort PrintManagement
Function Get-PrintConfiguration PrintManagement
Function Get-Printer PrintManagement
Function Get-PrinterDriver PrintManagement
Function Get-PrinterPort PrintManagement
Function Get-PrinterProperty PrintManagement
Function Get-PrintJob PrintManagement
Function Read-PrinterNfcTag PrintManagement
Function Remove-Printer PrintManagement
Function Remove-PrinterDriver PrintManagement
Function Remove-PrinterPort PrintManagement
Function Remove-PrintJob PrintManagement
Function Rename-Printer PrintManagement
Function Restart-PrintJob PrintManagement
Function Resume-PrintJob PrintManagement
Function Set-PrintConfiguration PrintManagement
Function Set-Printer PrintManagement
Function Set-PrinterProperty PrintManagement
Function Suspend-PrintJob PrintManagement
Function Write-PrinterNfcTag PrintManagement