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.

BKoo
  • 95
  • 3
  • 13
  • If you're going to use any remote commands that have a network location you need to fix the [double-hop](http://blogs.msdn.com/b/clustering/archive/2009/06/25/9803001.aspx) problem. – E.V.I.L. Jun 05 '13 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 – BKoo Jun 05 '13 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 – BKoo Jun 05 '13 at 18:09

1 Answers1

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.

Community
  • 1
  • 1
E.V.I.L.
  • 2,120
  • 13
  • 14
  • 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? – BKoo Jun 05 '13 at 22:42
  • So does that mean you got the double-hop issue fixed? – E.V.I.L. Jun 06 '13 at 01:25
  • 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. – E.V.I.L. Jun 06 '13 at 20:09
  • 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.. – BKoo Jun 07 '13 at 21:12
  • if I use this command after enter-pssession my powershell just hangs – BKoo Jun 07 '13 at 21:13
  • Start-Process -FilePath \\xxx-fs-1.ads.xxx.edu\software\npp.6.3.3 .Installer.exe -ArgumentList "/S" and I am running this command after running Enter-PSSession -authentication credssp -credential $cred -ComputerName xxx-fs-2.ads.xxx.edu – BKoo Jun 07 '13 at 21:14