How to Add a Software-Specific Printer to Multiple Machines?

0
9
Asked By TechWhiz789 On

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

Answered By PrintMaster2024 On

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'.

TechWhiz789 -

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

Answered By ScripterSam99 On

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`.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.