BKoo
BKoo

Reputation: 115

Powershell remote install .exe file errors and not finding setup.iss file

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.

Upvotes: 0

Views: 2173

Answers (1)

E.V.I.L.
E.V.I.L.

Reputation: 2166

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.

Upvotes: 0

Related Questions