Share via


Install Print Driver on Remote computers

Question

Monday, November 20, 2017 12:59 AM

Connecting windows 10 computers to print server.

I am using the type 4 driver and these drivers don't download & install from the print server to local computers, they want to use the enhanced driver instead.

I have been trying to install the driver remotely.

From Powershell

Enable-PSRemoting

From Command Prompt

psexec.exe \target -s powershell Enable-PSRemoting -Force

From Powershell

Invoke-Command -ComputerName 'target' {pnputil.exe -a "\hhac6581\c$\app\PDV61_02\Driver\cnnv4_cmsp6_bipr.inf" }

Result

PS C:\WINDOWS\system32> Invoke-Command -ComputerName COMPUTER {pnputil.exe -a "\COMPUTER\c$\app\PDV61_02\Driver\cnnv4_cmsp6_bipr.inf" }
Microsoft PnP Utility

Adding the driver package failed : Invalid INF passed as parameter.

Total attempted:              0
Number successfully imported: 0

Not sure what I have done wrong but I would love to be able to install the printer driver on windows 10 computers before connecting them to the print server, any help would be appreciated.

All replies (8)

Monday, November 20, 2017 2:06 AM

You cannot just hack your way into a remote system. Read the error messages.  The INF you seek does not exist on the remote system ot the INF is not valid.

This is not a scripting issue.

\(ツ)_/


Monday, November 20, 2017 2:22 AM

Worst reply I have ever received on Technet, that's a new one for me

the .inf file does exist but not sure if it is invalid but from what I see it shouldn't be.

I had the files on a network share but this error appeared then read on Technet forum to move the files to the local computer and try again, so I tried but failed.

I am focusing on trying to find out why I receive the below error message

"Adding the driver package failed : Invalid INF passed as parameter."

thought because I was using powershell to complete this task I was in the correct forum. I am guessing I am in the wrong forum due to your rude response, is that correct?


Monday, November 20, 2017 2:51 AM

The error message is quite explicit.  Have you actually read it?  If the file in invalid then that is not a scripting issue.  Get a valid file and try again.

\(ツ)_/


Monday, November 20, 2017 3:37 PM

Copy-Item works with remote computers using the -FromSession and -ToSession parameters.  Maybe try that way.  I would also use pnputil.


Monday, November 20, 2017 4:02 PM

Have you tried using the built-in Powershell "Add-WindowsDriver" cmdlet. 

I agree with jrv that the error is stating that the INF file is invalid. The problem is that the PNPUtil requires a drive letter, so you'll have to map the drive if you require installing from a network share. Or do like JS2010 suggested and use copy-item locally before utilizing PNPUtil.

I don't believe the Add-WindowsDriver cmdlet has the same limitation, but give it a shot and let us know.

Format for driver file path in PNPUtil: /en-us/windows-hardware/drivers/devtest/pnputil-command-syntax#comments

Documentation on Add-WindowsDriver cmdlet: /en-us/powershell/module/dism/add-windowsdriver?view=win10-ps


Monday, November 20, 2017 4:07 PM

You also cannot access a remote share from a remote session.  Look up "second hop restriction".  The file must be local to the remote system.

\(ツ)_/


Monday, November 20, 2017 4:08 PM

Completely forgot about that. Thanks for the sanity-check, jrv


Monday, November 20, 2017 4:15 PM

Add-WindowsDriver doesn't work with online systems.