dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
3079

PToN
Premium Member
join:2001-10-04
Houston, TX

PToN

Premium Member

Powershell Remote execution help

Hello,

I've been trying different ways and i am still unable to get this done. I am trying to remotely install applications on windows 7 enterprise via powershell scripts.

I tried this:
Enter-PSSession -ComputerName COMPUTER -Credentials DOMAIN\Administrator | Invoke-Command {Start-Process "msiexec.exe" -ArgumentList "/i \\path\to\the\app\setup.exe /s /v`" /qn OTHER=stuff`"" -wait}
 

It just sits there, nothing happens... I dont even get an error. I also tried:
Enter-PSSession -ComputerName COMPUTER -Credentials DOMAIN\Administrator | Invoke-Command {Start-Process "\\path\to\the\app\setup.exe" -ArgumentList "/i  /s /v`" /qn OTHER=stuff`"" -wait}
 

Nothing seems to work... Any ideas?

Thanks.

Weasel
Premium Member
join:2001-12-03
Minnesota

Weasel

Premium Member

I don't know Powershell enough to help there without the google, but have you tried using PSExec?

PToN
Premium Member
join:2001-10-04
Houston, TX

PToN

Premium Member

Yeah, i've used PSExec, but was trying to unify everything into powershell as i've been writing a bunch of scripts and it is native to windows 7.

Thanks though.!

Weasel
Premium Member
join:2001-12-03
Minnesota

Weasel to PToN

Premium Member

to PToN
My other thought is the .exe. My experience when trying to remotely install an app that comes packaged in an .exe never has ended well. .msi files do well.

I don't know the program you are deploying so I can't say the above is your issue, but putting it out there for discussion.

PToN
Premium Member
join:2001-10-04
Houston, TX

PToN

Premium Member

Well, the app has a switch to pass args directly to msiexec. But you have to start it with their exe. I gave up on that one and installed it manually as only a few people use it.

I tried with Chrome and it worked fine with:
$myses = New-PSSession -ComputerName COMPUTER -Credential user@domain
Invoke-Command -Session $myses -ScriptBlock {Start-Process -FilePath "$env:systemroot\System32\msiexec.exe" -ArgumentList "/q /I C:\Deploy\GoogleChromeStandaloneEnterprise.msi" -wait}
 

Thanks.
applerule
Premium Member
join:2012-12-23
Northeast TN
(Software) pfSense
ARRIS SB6183
Asus RT-N66

applerule

Premium Member

Maybe too late...but how about...

Enter-PSSession -ComputerName COMPUTER -Credentials DOMAIN\Administrator | Invoke-Command {Start-Process "\\path\to\the\app\setup.exe" -ArgumentList '/i /s /v /qn" OTHER=stuff"' -wait

Not sure how your app is accepting arguments and where it needs its quotes but you can put powershell arguments in single quotes instead of double, and pass double quotes easily without having to escape them.
mkaishar
join:2000-12-20
00000

mkaishar to PToN

Member

to PToN
»technet.microsoft.com/en ··· 961.aspx

Set-ExecutionPolicy RemoteSigned