This question is in addition to the following thread which already was marked as answered:
http://social.technet.microsoft.com/Forums/windowsserver/en-US/7a2db68a-659d-4ba2-b732-52b55b9688cd/addprinterdriver-infpath?forum=winserverpowershell
Here's what I'm currently trying to achieve:
We're currently using 10 printserver appliances for publishing about 1k printer queues to the AD and making them available to the users. Sometime this year those printserver appliances will have to be replaced by a Windows printserver, because of ongoing
problems we regularly encounter with the current solution.
I tried to create a PowerShell script to migrate all the printers from the appliances to the Windows server, which checks for published queues in the AD, installs the needed drivers on the Windows server and installs the printers as a last step.
I was rather happy to see that new Cmdlets were introduced with Server 2012 which seemed to be pointed exactly at what I wanted to achieve.
Here's my current problem:
Using Add-PrinterDriver didn't work as it should for a majority of our printers as their drivers are not available in the Windows driver store by default.
Using Add-WindowsDriver didn't work as it only allows drivers to be installed into offline images, not into the currently running system.
Using pnputil to add the driver to the driver store worked great, although it feels like a break in technology usage when calling this from PowerShell.
But, to get down to the core problem, Add-PrinterDriver doesn't seem to recognize a x86 driver in the driver store even if it was successfully added by pnputil. Here's an example with a HP PostScript universal printer driver (commands were taken from the script
I mentioned earlier):
PS C:\Windows\system32> pnputil -a $AvailableX64Drivers[$Printer.driverName].Driver
Microsoft PnP Utility
Processing inf : hpcu155v.inf
Driver package added successfully.
Published name : oem11.inf
Total attempted: 1
Number successfully imported: 1
PS C:\Windows\system32> pnputil -a $AvailableX86Drivers[$Printer.driverName].Driver
Microsoft PnP Utility
Processing inf : hpcu155d.inf
Driver package added successfully.
Published name : oem16.inf
Total attempted: 1
Number successfully imported: 1
PS C:\Windows\system32> Add-PrinterDriver $Printer.driverName -PrinterEnvironment "Windows x64" -ErrorAction Stop
PS C:\Windows\system32> Add-PrinterDriver $Printer.driverName -PrinterEnvironment "Windows NT x86" -ErrorAction Stop
Add-PrinterDriver : The specified driver does not exist in the driver store.
At line:1 char:1+ Add-PrinterDriver $Printer.driverName -PrinterEnvironment "Windows NT x86" -Erro ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (MSFT_PrinterDriver:ROOT/StandardCimv2/MSFT_PrinterDriver) [Add-PrinterDriver], CimException+ FullyQualifiedErrorId : HRESULT 0x80070705,Add-PrinterDriver
PS C:\Windows\system32>
The file hpcu155v.inf is confirmed to be the correct x64 driver and the file hpcu155d.inf is confirmed to be the correct x86 driver. Both work correctly when installing them using the printer driver wizard.