Run Install.exe for remote Computers using Powershell

jskfan
jskfan used Ask the Experts™
on
Run Install.exe for remote Computers using Powershell

I have HP Drivers folder in the Network , inside the HP Drivers folder there is a file called Install.exe.
I would like to have a script reads computer names from csv file and run the Install.exe silently on each computer listed on CSV file.
The Install.exe will install printer , I would like it to pick up the "HP Universal Printing PCL 6" as driver.

Any Help will be very much appreciated.

Thank you
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Shabarinath RamadasanInfrastructure Architect

Commented:
Hello,

Try something like this...

$command = “cmd.exe /c \\networkfileshare\exefolder\exename.exe /s /v`”/qn”
$process = [WMICLASS]“\\PCName\ROOT\CIMV2:win32_process“
$process.Create($command)

Open in new window


However, exe needs to support silent mode installation to get this working.
May be an msi could give better flexibility.

Hope that helps !
It's possible to install UPD silent by running
Install.exe /q /h

Open in new window

Author

Commented:
I thought the /q means quiet mode, it will run the command silently.
I will try it on one computer. in the mean time if you can make that code run on several computers read from the csv file, that will be great.

Thank you
Mike TLeading Engineer

Commented:
Hi,
Yes /q means quiet. If you read the UPD docs I am sure it says /q /h.
Why are you doing this with PowerShell if you have ConfigMgr? It's a lot easier with CM.
Shaun VermaakSenior Consultant
Awarded 2017
Distinguished Expert 2018

Commented:
Post install.exe

Author

Commented:
Shaun Vermaak

This is for HP Printers Install.
I have downloaded drivers and saved them  in the network. Instead of going to each computer and type in \\servername\sharename\Install.exe and follow the wizard and select "HP Universal Printing PCL 6", I want the script to do that for each computer listed in CSV file.

Thank you

Author

Commented:
I tried both of these options on local computer :
Install.exe /s /v ”/qn”

Open in new window

and

Install.exe /q /h

Open in new window


they just open the Printer Install wizard instead of doing the Install automatically without showing the Wizard's GUI
Shaun VermaakSenior Consultant
Awarded 2017
Distinguished Expert 2018

Commented:
Then post a link to download it

Author

Commented:
Mike TLeading Engineer

Commented:
Hi,

I was trying this HP Tool before Christmas and it does install silently, but I don't have the exact details here and won't until I return to work in Jan.

Please download the PARK zip file on the same page as the link you gave above. The PDF gives full details of deploying UPD including managing things with GPOs. On page 54 is a table of the command line options for Install.exe.
Ref: http://h10032.www1.hp.com/ctg/Manual/c03633736
(an older pdf).

I have to ask at this point - are you a novice in PowerShell? Your answer will change the answers you get from Experts. I am not sure if you are asking for a full enterprise ready script or just a rough skeleton to point the way.

Finally for this to work you need all machines to have PowerShell remoting enabled. is it? Also what is the target OS?

Author

Commented:
Novice to Powershell ?  Yes
I need a script that can accomplish this task. Target OS is Windows 10.

It should be straight forward... Now I can go to any computer and Run the Add Printer Wizard, and select the HP as manufacturer on the left pane , it will show all the drivers on the right pane , I can select "HP Universal Printing PCL 6", and follow the wizard to add the printer and be able to print the test page...

Now how can I do that with a Script instead of doing it manually ?

Thank you
Silent install, for example:
This will install HP UPD silently in dynamic mode:
install.exe /q /h /npf /dm

Open in new window

Will show a bunch of options you can use
install.exe /?

Open in new window


install.exe /sm192.168.1.111 /n"HP Printer" /q /npf

Open in new window

seems to be able to create the required TCP port also

Like Mike T posted, you can use PARK to pre-configure the printer settings (duplex, etc.) and use the config file during installation (/gcfm)
I can't test here but this should bring things together:

$computers = Import-CSV computerlist.csv
$computers | {Invoke-Command -ComputerName $_ -ScriptBlock {& \\SERVER\Networkfolder\install.exe /q /h .... }

Open in new window

Author

Commented:
Like Mike T posted, you can use PARK to pre-configure the printer settings (duplex, etc.) and use the config file during installation (/gcfm)

where can I get that ?

Thanks

Author

Commented:
Downloaded  PARK...
However the issue that I have is not on the configuration....

every computer I remote to has UPD PCL 6 when I add the printer using Add Printer Wizard...
The issue is the script for some reason does not install properly the driver even though it shows installed.

searched and found something similar to my issue on this link:
https://msfn.org/board/topic/26296-installing-network-printers-silently-heres-how/

however the author did not explain clearly how to deploy the registry file with the  the script.

Thank you
Whats the mode you're installing?
Is the port getting created when using static mode?

Author

Commented:
p
you can see even when you try it silently , it will open up the Wizard
The wizard comes up because you're not providing "static" or "dynamic" mode.
Running install.exe /? provides help for the parameters available.

Try

install.exe /sm192.168.1.111 /n"HP Printer" /q /npf

Open in new window


and replace the IP address with the IP of one of your printers.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial