Powershell – Using Powershell’s Invoke-command to install .exe on remote computer

powershell

I have an .exe I would like to install on a large farm of Windows Server 2008 computers. I am attempting to use Powershell remoting. I have this command which works locally:

invoke-command {& "N:\Temp\fortify_installer\HP-Fortify-3.20-Analyzers_and_Apps-Windows-x86.exe /s /f1N:\Temp\fortify_installer\response.iss"}

But when I add the -computername flag it seems to go off to nowhere, and the installer is never run on the remote machine.

I can launch notepad.exe via the same command and it runs. Does it have something to do with it being an installer, or something else? I realize many versions of this question have been asked and I have read them, but I am still confused as to why this doesn't work.

Best Answer

The invoke-command requires the remote computer to be configured for remote management. Running Remote Commands

If you are unable to configure remote management you could use Windows Management Instrumentation (WMI) for the remote execution. Execute program on remote computer using PowerShell