Run PowerShell Scripts Remotely

Spread the news
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Overview

With Bozteck VENM, you have the ability to run your own PowerShell scripts remotely on PC’s connected to your network.  This article will explain how to accomplish this easily.

Prerequisites

The remote computers must have WinRM enabled in order to run PowerShell scripts from remotely. If you do not have WinRM enabled and attempt to run a script against that PC, you will encounter the error message in Figure 1.

Figure 1 – WinRM error

Connecting to remote server failed with the following

To correct this error, you will need to run the following command on the remote PC before it is able to accept remote PowerShell Scripts:

winrm quickconfig

If you have a large number of computers to do this for, you can use VENM to run this as a CMD script.  Simply follow the same steps that you see here for running PowerShell scripts except for the script type, choose CMD and use the command above.

How It Works

1. Begin by opening the script editor.

image

 

2014-10-22_1033

 

2. Name your script and put your PowerShell commands in the script window on the right.  Optionally, you can set conditions for your script to only execute in certain environments.

You may also include files with your script which will be copied to c:tempvncscan on the remote computer( s ) prior to execution.

 

2

 

3. Back at the main console window, select your script from the dropdown in the task panel shown below.

3

4. Select one or more computers from the list and press the “Execute” button.

 

4

 

Conclusion

You can run many script types this way including Windows batch scripts, KiXScript. VB Script, and more.

The ability to run these scripts remotely is typically an enterprise feature in management suites costing many thousands of dollars.  Bozteck VENM allows you to do this easily for almost nothing.