- Embotics vCommander 5.7.7 or later
- Embotics vCommander REST API PowerShell client (2.7.3) & libraries
- PowerShell v4 installed on the vCommander application server
- vCommander script
- Encrypted vCommander credentials with REST API access
Preparing the Script
Download and extract the script to your vCommander application server. Embotics recommends storing all scripts called by vCommander in a single location, using sub-folders to identify the functions of scripts. With the script used for this solution extracted to C: on the vCommander server, the file system will look like this:
The script requires minor edits before it will work with your system.
|$vCommanderHostName||The hostname or IP address of the vCommander server.|
|$encryptedCredsFile||The credentials file which handles access to your vCommander. For more details refer to this knowledgebase article.|
|$rejectionAge||The age of failed service requests to be set as rejected, in days.|
|$transcriptFile||Filename and location of the transcript file to log this script's activity.|
|$transcriptEnabled||Set to true to record the script's activity to the log file named above.|
Creating the Scheduled Task
Windows Task Scheduler is used to execute the script on a schedule you define. The steps below are an example using Windows 2008 R2. Other versions of the server OS may introduce slight variations. If you encounter these, please refer to Microsoft documentation or contact Embotics Technical Support for assistance.
- Logged in as an Administrator, open Task Scheduler from the Administrative Tools in the Start Menu.
- In the Actions pane, click Create Basic Task.
- Name the task Reject Failed vCommander Service Requests and add a meaningful Description. Click Next.
- Choose to trigger the task Daily and click Next. Choose a time to run the task, and set it to recur every day. Click Next.
- Choose Start a program and click Next.
- Click Browse... to locate the PowerShell executable. Set Add arguments (optional) to the following and click Next:
- Click Finish.
The task name will now appear in the Active Tasks list in the Task Scheduler.