Tuesday, October 04, 2011

Talking Server to Server in Powershell – Remote Scripting


First – let me say this is not just Server to Server but also Desktop/Laptop to Server –
wherever you have PS capabilities.

A couple of things have to be considered before you attempt to force script to run on a
remote machine:

1. You have permissions on the remote machine to run script

2. You have security permissions on the remote machine to make the changes
After that, it’s a simple line of code from the Powershell command line:

Invoke-Command –ComputerName MyComputerName –FilePath C:\FileLocation\MyFile.ps1


MyComputerName = Name of remote machine

C:\FileLocation\MyFile.ps1 = The local path of the PS file from the machine you a

No comments: