因此,我的任务是获取所有可以彩色打印的打印机的报告。我从这里找到了一个脚本(http://voices.yahoo.com/listing-printers-ips-using-windows-powershell-6617942.html?cat=15),该脚本适用于所有内容,但如果显示颜色则无效。

Get-WMIObject -class Win32_Printer -computer $printserver | Select Name,DriverName,PortName,CapabilityDescriptions

我以为'CapabilityDescriptions'可以使用,但这是基于驱动程序的,我们正在使用HP Universal Printing PS。

因此,我仔细检查了一下,实际上是在打印服务器上,然后进入“功能”下“常规”选项卡上的打印机属性,其中列出了“颜色”。

实际上,彩色打印机说"is",而不是彩色打印机说“否”。

现在,PowerShell脚本还有其他类型的变量,我找不到每种打印机的颜色“是/否”吗?

谢谢!

最佳答案

不确定运行的是哪个版本的PowerShell以及是否可以访问Windows 8计算机,但是如果这样做,PrinterManagement模块将为您提供帮助,因为它似乎可以正确识别彩色打印机(我们也使用通用驱动程序):

PS> get-printconfiguration -ComputerName $printserver -PrinterName $nonprinter

PrinterName     ComputerName    Collate    Color      DuplexingMode
-----------     ------------    -------    -----      -------------
printername       servername   False      False      OneSided

PS> get-printconfiguration -ComputerName $printserver -PrinterName $colorprinter

PrinterName     ComputerName    Collate    Color      DuplexingMode
-----------     ------------    -------    -----      -------------
printername       servername   False      True       OneSided

关于powershell - 查找打印机是否能够进行彩色打印,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18665180/

10-15 01:51
查看更多