How to Redirect AutoShell Results to a File

Document ID : KB000032549
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction:

AutoShell is available to do a number of task from the command line within VAIM. Due to the way that Autoshell is designed and functions, it is not possible to save AutoShell command output either in a variable, or to directly redirect to a file using standard Windows command line syntax ( "> file.txt"). This describes how to have AutoShell output to a file.

 

Instructions:

The only to have AutoShell output to a file is to use the "set alternate to" syntax prior to running the desired AutoShell commands. Example:

set alternate to ("C:\\output.txt")

Below a more detailed example that will list the policies that are applied to the specified host.

Put the following into a file (script.js for example):

set console off
set alternate to ("C:\\output.txt")
ism-listSystemPolicies -hostName (arguments[0])

Run the following command (replacing USER, PASS, and HOST accordingly):

C:\Program Files (x86)\CA\SC\AutoShellManager\caaipaomautoshell.exe -U USER -P PASS -f c:\script.js HOST

 

AutoShell will write all output to "C:\output.txt". This file can be read in/parsed via other scripts/code as needed.

 

Additional Information:

Virtual Assurance for IM - Reference Guide