I'm looking to manually add a printer across several hundred machines for a specific software we're using. I've been trying to script the process, but I keep running into this error message. I'm not an expert in scripting and pieced this together from various online resources. Any help on where I might be going wrong would be greatly appreciated!
Here's the code I'm using:
$DriverUnpackPath = "C:Program Filesgsgs10.05.0lib"
$DriverName = 'ghostpdf.inf'
$PrinterIconName = 'Sybase Datawindow PS'
$PortName = 'FILE'
$PrintProcessor = 'winprint'
$Datatype = 'RAW'
I'm trying to add the printer driver first with:
Add-PrinterDriver -Name $DriverName -ErrorAction Stop -Verbose
And I get this error:
VERBOSE: Adding new driver ghostpdf.inf
Add-PrinterDriver : The specified driver does not exist in the driver store.
At line:8 char:1
+ Add-PrinterDriver -Name $DriverName -ErrorAction Stop -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (MSFT_PrinterDriver:ROOT/StandardCimv2/MSFT_PrinterDriver) [Add-PrinterDriver], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070705,Add-PrinterDriver
2 Answers
Just a heads up, when specifying the printer driver's name, use the actual name and not the filename. For example, it should be something like 'Universal Print Class Driver' or 'Microsoft Print To PDF'.
It sounds like the driver isn't recognized by the remote system. Have you injected it into the remote driver store? You might want to try using pnputil.exe to add the driver like this: `pnputil.exe /add-driver C:PathTodriver.inf`.

I tried that too and just used 'ghostpdf' which is its real name, but still no luck.