Link to home
Start Free TrialLog in
Avatar of williamwlk
williamwlk

asked on

How to execute powershell script remontely in remote powershell

How can I run a powershell script called abc.ps1 loaded in Machine B from Machine A.


I'd like to use psexec from Macine A.

 
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of williamwlk
williamwlk

ASKER

     psexec \\machineB %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe C:\ABC.PS1

Like this?

W
Double the percent signs. That command line would try to call the powershell.exe remotely, but assuming it is on the same path as is on the calling PC. But besides that - yes, that is what I had in mind.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks