Trouble Installing MSI Remotely with Invoke-Command

April 26, 2025 1 answer
Asked by TechWiz4Life
I'm trying to install an MSI using a PowerShell script, and it works fine when I run it locally (via Start-Process with the appropriate parameters). However, when I attempt to use 'Invoke-Command' to run it remotely, it fails, potentially due to not getting the required 'Run As Administrator' context. I consistently get exit code 3, and my MSI log shows issues related to service actions. Can anyone offer insights or solutions? Here are the specific commands I've been using locally: Start-Process 'msiexec.exe' -Wait -Verb runas -ArgumentList '/i \publictoolsinstallablesexecslightspeedSmartAgentx64-3.1.2.msi /passive /log C:msiexec.log'. Any help would be greatly appreciated!

Answers

ScriptingSage77
You might not need the 'Run As Administrator' since `Invoke-Command` should already run with elevated privileges if your user is an admin on the remote machine. Also, some installers require a full desktop session to run correctly. Check the logs for any additional errors that might provide more details.

TechWiz4Life: I've added more details to the original post with the specific log errors.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions