Run PowerShell Script Remotely

By |2017-12-08T16:21:33+00:00June 2nd, 2011|PowerShell|0 Comments

If you have PowerShell 2.0 installed on machines in your environment, then you are able to execute PowerShell scripts on remote machines straight from your local machine.

First make sure you enable remote script execution on your Local and Remote machine by running the following in PowerShell.

Enable-PSRemoting –force

Now place the PowerShell script you want to execute on a location on your local machine.

Now we can run the following PowerShell command to execute the script on the remote machine Smile (Edit the below highlighted in red to match the remote machine name and the PowerShell file location)

Invoke-Command -ComputerName machinename -FilePath C:FileLocationfilename.ps1

Leave A Comment

like what you see? 

Sign-up to our newsletter and never miss out on the latest blogs, events and tech news from the world of risual
Give it a try, you can unsubscribe anytime.