0

Hi I am trying to figure out how to install .exe files to 5 server machine but I am having trouble trying to install silently on my own machine. I have this command Invoke-Command -ScriptBlock {Start-Process -FilePath \\xxx-STUDENT3-W7\Users\bkoo004\Documents\test\ccleaner402.exe \r} but I can't find the setup.iss file in the Windows folder. Also when I use this command

Invoke-Command -computername xxxxxxxxxxx.edu -ScriptBlock {start-process -filepath "\\xxx-S TUDENT3-W7\Users\bkoo004\Documents\test\ccleaner402.exe" } -Credential $cred

It gives me an error saying that This command cannot be executed due to the error: The network name cannot be found. + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

But I know that network name is right because when I run Invoke-Command -computername xxxxxxxxxxx.edu -ScriptBlock {get-process } -Credential $cred It returns the get-process of that server.

I figured that for not getting the setup.iss file it is because the program that i am trying to install doesn't use installshield but for the error trying to run start-process on my remote server I have no idea what it is.

3
  • If you're going to use any remote commands that have a network location you need to fix the double-hop problem. Commented Jun 5, 2013 at 17:54
  • New-PSSession xxxxxxxxxx.edu -authentication CredSSP -credential $cred | Invoke-Command -computername xxxxxxxxxxxx.edu -ScriptBlock {start-process -filepath "\\xxx-STUDENT3-W7\Users\xxxxxx\Documents\test\S etup.exe" } using that command I still get network not found error Commented Jun 5, 2013 at 18:06
  • Also I don't get how what I am trying to do causes double hop problem? I am not trying to make my server access remotely to anywhere. Sorry I am really noob in this area Commented Jun 5, 2013 at 18:09

1 Answer 1

0

Not sure if you are running into the double-hop problem on not, but it sounds like you are. So I though I'd give you a little more information about it. The Bob Loblaw version.

What is a server and what is a client? A server, it accepts things, is the computer you remote onto. A client, it gives things, is the computer you use to do the remoting. So in the command Invoke-Command -computername xxxxxxxxxxx.edu ..., "xxxxxxxxxxx.edu" is the server.

From your description, it looks like you already ran the command Enable-PSRemoting on your server. With remoting enabled on the server you should be able to do Enter-PSSession -ComputerName xxxxxxxxxxx.edu and have an interactive command prompt on the client.

If you enter a remote session and do Get-ChildItem "\\ComputerName\Share" the command is going to fail (it fails for safety reasons). That's the double-hop, because you're going from one computer to another. The network share is another computer. So you're going like this:

Client -> Server -> Network Share

Hippity-Hoppity

You need to setup more "things" to fix the double-hop. First on your server(s) you need to run the command Enable-WSManCredSSP Server so it will accept credentials from clients. Second on your client(s) you need to run the command Enable-WSManCred -Role Client -DelegateComputer * so it gives out your credential to servers.

Now with CredSSP configured to give and accept credentials, you should have resolved the doulbe-hop.

Enter-PSSession -ComputerName Computer1 -Authentication Credssp -Credential (Get-Credential)

Now you should be able to get to your network shares from the remote session Get-ChildItem "\\ComputerName\Share".

Hope this helps you out a bit.

P.S. There is always money in the banana stand.

Sign up to request clarification or add additional context in comments.

6 Comments

When I use this command Invoke-Command -computername xxx-fs-2.ads.xxx.edu -authentication credssp -credential $cred -ScriptBlock {start-process -filepath "\\xxx-fs-1.xxx.ucr.edu\software\npp.6.3.3.Installer.exe" -argumentlist "/S" } My powershell just hangs. My guess is that there is a security warning check to open .exe file. How can I bypass this?
So does that mean you got the double-hop issue fixed?
The next thing I would test is enter an interactive session, using Enter-PSSession and see if \\Computer\Share\NPP.exe /S will install. If that don't work you might have better luck asking another question. I'm not a pro on remote installations. I don't know if the installation getting stuck would have to do with UAC or not. But I do believe when you run an installation file the prompt will only return once the installation is finished, it think.
When I used Enter-pssession and try to install it I get access denied error if i do not use credssp and I get requires elevation error if I use credssp..
if I use this command after enter-pssession my powershell just hangs
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.