即使在检查文件夹之后,Add-PrinterDriver也不会在驱动程序存储区中显示任何驱动程序。使用过pnputil.exe但没有运气

时间:2019-09-27 01:00:22

标签: powershell network-printers

我搜索了很多线程,但是还没有找到解决方案,因此请继续。 我想创建一个可以远程安装的打印机脚本。

Get-ChildItem$deployment-Filter*.inf-Recurse|%{pnputil.exe/a$_.FullName}
Get-PrinterDriver    
Add-PrinterDriver-ComputerName$computerName-Name$model-verbose    
Add-PrinterPort-ComputerName$computerName-Name$printerHost-PrinterHostAddress$printerIP-verbose    
Add-Printer-ComputerName$computerName-PortName$printerHost-Name$printerHost-DriverName$model-verbose 

可以安全地假定$ deployment具有所需的.inf文件,$ computerName是正确的并且可以访问。 $ model的名称是“ Xerox Global Print Driver PS”

Processing inf :            x3UNIVP.inf
Driver package added successfully.    
Published name :            oem53.inf    

Total attempted:              1

Number successfully imported: 1


Name                               PrinterEnvironment MajorVersion    Manufacturer             

----                               ------------------ ------------    ------------             

Send to Microsoft OneNote 16 Driver Windows x64        4              Microsoft                

Microsoft XPS Document Writer v4    Windows x64        4              Microsoft                

Microsoft Print To PDF              Windows x64       4               Microsoft                

Xerox Global Print Driver PS        Windows x64        3              Xerox                    

Microsoft Shared Fax Driver         Windows x64        3              Microsoft                

Microsoft enhanced Point and Pri... Windows x64        3              Microsoft                

Amyuni Document Converter 500       Windows x64        3              AMYUNI Technologies      

Microsoft enhanced Point and Pri... Windows NT x86     3              Microsoft                


VERBOSE: Adding new driver Xerox Global Print Driver PS


Add-PrinterDriver : The specified driver does not exist in the driver store.

At \\c204196\alans$\Printer scripts\Printer Dropdown Script\Printer Installation.ps1:71 char:5

+     Add-PrinterDriver -ComputerName $computerName -Name $model -verbo ...

+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (MSFT_PrinterDriver:ROOT/StandardCimv2/MSFT_PrinterDriver)[Add-PrinterDriver], CimException

    + FullyQualifiedErrorId : HRESULT 0x80070705,Add-PrinterDriver 

我仍然收到驱动程序存储中不存在的错误消息。

非常感谢您的帮助。

此脚本已经运行了很多次,但似乎在新安装的PC上失败。

谢谢!

0 个答案:

没有答案