Take the 2-minute tour ×

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.

share|improve this question
Maybe the remote computer doesn't have an 'N:' drive? –  rene Dec 28 '11 at 16:35
it does. Thanks –  Bernie Dec 28 '11 at 18:20
also the notepad.exe works remotely? What happens when you invoke-command -computername server1 "cmd /c dir N:\temp* > c:\windows\temp\remote.lst"? Do you have a remote.lst file on server1 which list the files on N:? Is N: a network drive htat gets mapped during logon? –  rene Dec 28 '11 at 18:27
N is a local partition, not a network drive. That command didn't work for me from the console. Didn't like the wildcard, then when I removed it said only script files are acceptable for filepath parameter, which was not even in the command.... –  Bernie Dec 28 '11 at 18:47
I don't see anything parameters to the installer telling it to install non-interactively. Are you sure this thing is not trying to popup some kind of interactive window on the remote machine? The remote powershell server process is non-interactive. When you run it without -computer, it is using your local interactive session. –  x0n Dec 29 '11 at 3:58
show 2 more comments

migrated from stackoverflow.com Dec 30 '11 at 16:09

This question came from our site for professional and enthusiast programmers.

3 Answers

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

share|improve this answer
I think I have Remote Management configured on all computers. I am able to use invoke-command to do other stuff...Thanks! –  Bernie Dec 28 '11 at 17:58
Is your command structure? Invoke-command -Computername Server01 -Scriptblock {& "N:\Temp\fortify installer\HP-Fortify-3.20-Analyzers_and_Apps-Windows-x86.exe"} –  jmh6182 Dec 28 '11 at 18:34
I don't have -ScriptBlock in there, but other than that it is. –  Bernie Dec 28 '11 at 18:48
add comment

I am going off the assumption that your command in the scriptblock is correct. Does the Invoke-command complete or do you have to kill the command? Try the command and have the results returned to a variable like this:

$var = Invoke-Command -ComputerName <Computer> -ScriptBlock {& "N:\Temp\fortify_installer\HP-Fortify-3.20-Analyzers_and_Apps-Windows-x86.exe /s /f1N:\Temp\fortify_installer\response.iss"}

Everything looks ok other than I would add the -scriptblock parm for clarity. Try putting what you have in the scriptblock in a .PS1 file and then use the -filepath parm with the location of the ps1 script you just created.

This very well could be an interactive session issue but the results of your invoke-command should give this to you. Otherwise you may need to look at event logs on that remote machine and see if anything turns up there.

share|improve this answer
add comment

Could you try the following:

  1. Enter-pssession to check that your remoting config works

  2. Copy the exe from N: (I'm assuming this is a mapped drive on the server) to C: or some local disk and run the script again after adjusting the path? There is a good chance double-hop authentication interferes with your script.

share|improve this answer
add comment

Your Answer

