How to Redirect AutoShell Results to a File
search cancel

How to Redirect AutoShell Results to a File

book

Article ID: 32549

calendar_today

Updated On:

Products

CA Server Automation CA Virtual Assurance for IM

Issue/Introduction

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

Environment

Release: SEAUBC99000-12.7-Server Automation-Base Configuration
Component: