主頁 > 知識(shí)庫 > PowerShell中使用PrintManagement管理打印機(jī)示例

PowerShell中使用PrintManagement管理打印機(jī)示例

熱門標(biāo)簽:使用電話機(jī)器人電銷是否違法 安徽400電話辦理 雷霆電話機(jī)器人電話 什么渠道可以找外呼系統(tǒng)客戶 信陽話務(wù)外呼系統(tǒng)怎么收費(fèi) 湖州電銷防封卡 金融電銷公司怎么辦理外呼系統(tǒng) 電話智能外呼系統(tǒng)誠(chéng)信合作 真人和電話機(jī)器人對(duì)話

適用于Windows 8.1或者Windows Server 2012 R2

Windows 8.1和Windows Server 2012 R2引入了一個(gè)組件:“PrintManagement”,它包含了所有用來管理本地和遠(yuǎn)程機(jī)器打印機(jī)的命令。

下面的例子演示安裝打印機(jī)驅(qū)動(dòng)和打印機(jī)端口,先安裝一個(gè)打印機(jī),分享它,并設(shè)置一些屬性。

復(fù)制代碼 代碼如下:

$ComputerName = $env:COMPUTERNAME
 
$DriverName = 'Samsung SCX-483x 5x3x Series XPS'
$IPAddress = '192.168.2.107'
$PortName = 'NetworkPrint_192.168.2.107'
$PrinterName = 'BWPrint'
$ShareName = 'Office 12'
 
Add-PrinterDriver -ComputerName $ComputerName -Name $DriverName
Add-PrinterPort -Name $PortName -ComputerName $ComputerName
Add-Printer -ComputerName $ComputerName -Name $PrinterName -DriverName $DriverName -Shared -ShareName $ShareName -PortName $PortName
Set-PrintConfiguration -ComputerName $ComputerName -PrinterName $PrinterName -PaperSize A4

當(dāng)然,你要運(yùn)行它,得確保調(diào)整變量 $IPAddress 指向真實(shí)存在的打印機(jī)地址。把$ComputerName 從本地機(jī)器名更改為遠(yuǎn)程機(jī)器名。

可以這樣查看PrintManagement 組件中所有的PowerShell命令:

復(fù)制代碼 代碼如下:

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

其實(shí),它們只是一些PowerShell函數(shù),而不是編譯的二進(jìn)制命令。

標(biāo)簽:運(yùn)城 湛江 德州 鶴崗 岳陽 濟(jì)南 山南 六盤水

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《PowerShell中使用PrintManagement管理打印機(jī)示例》,本文關(guān)鍵詞  PowerShell,中,使用,PrintManagement,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《PowerShell中使用PrintManagement管理打印機(jī)示例》相關(guān)的同類信息!
  • 本頁收集關(guān)于PowerShell中使用PrintManagement管理打印機(jī)示例的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章