Ariane B. Lefrancois
Ariane B. Lefrancois

Reputation: 21

Msi doesn't run on a remote server with psexec : msiexec exit with code 0

I am trying to install a .msi on a remote server using the following command :

psexec \\computername -u adminname -p password -s -i msiexec.exe /i C:\share\myfile.msi

When I launch it I see the msiexec.exe process in process explorer on the remote but the process seems to be idle, and it stays like this until I close the parent process (psexec). I know that that msi create some folder in the C:\ drive of the remote machine directly so maybe a problem with the admin right ? The -u and -p I am giving have admin rights on the remote.

psexec -u adminname -p password -s -i msiexec.exe /i C:\share\myfile.msi works if I type it on the remote directly. Any thing I am doing wrong ?

Update : if I remove the -i I get msiexec.exe exit with code 0 just after launching psexec.

Update 2 : I have tried to perform the same action on the same server using c# and WMI and I get the following error : A security package specific error occurred. (Exception from HRESULT: 0x80070721) maybe both of them are from the same issue/security option.

Upvotes: 1

Views: 10298

Answers (4)

Elaine Lin
Elaine Lin

Reputation: 541

I resolved my issue by copying the msi file to the remote server.

Copy-Item FileToInstall.msi -Destination \\Server\C$\DestinationFolder
psexec \\Server cmd /c "msiexec.exe /i C:\DestinationFolder\FileToInstall.msi /quiet /norestart"

Upvotes: 2

Jason Crease
Jason Crease

Reputation: 1985

Try also passing -h to force elevation. It fixed the same problem for me! In your case:

psexec \\computername -h -u adminname -p password -w c:\share -s -i msiexec.exe /i myfile.msi

Upvotes: 0

Stephen Connolly
Stephen Connolly

Reputation: 1639

You shoul add /qn! To suppress the ui and add /l*v log.txt to generate a log file

Upvotes: 0

Loïc MICHEL
Loïc MICHEL

Reputation: 26170

Psexec needs to know the remote working directory (-w) try : psexec \\computername -u adminname -p password -w c:\share -s -i msiexec.exe /i myfile.msi

Upvotes: 0

Related Questions