EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB230911: How to pass the contents of a Command Line execution to a parameter in a workflow in MicroStrategy System Manager.


Community Admin

• Strategy


How to pass the contents of a Command Line execution to a parameter in a workflow in MicroStrategy System Manager.

SUMMARY

This technical note outlines how to pass the contents of a Command Line execution to a parameter in a workflow in Strategy System Manager.
 
In some scenarios, it is useful to obtain the results of a Command Line execution and pass them into a parameter in System Manager. The workflow subset to achieve requires use of redirection operators in Windows. The steps to achieve the above are as follows:
 
1. Create a new parameter by going to the Parameters pane in the right of the System Manager GUI. Leave the value blank.
 

ka04W000000Oc7JQAS_0EM4400000029HX.jpeg

 
2. Create an Execute Application node in the workflow. Check the check box for Execute in System Shell and under Application to Execute, use the following syntax:
 


"desired command without quotes" > C:/Absolute/Path/To/file.txt

 
An example of the above is as follows:
 

DATE /T > C:/users/administrator/desktop/systemdate.txt

 
The > symbol is the redirection operator which will write the results of the script to a file in the location specified after the >. The file path specified should be accessbile to the user logged in and running the System Manager workflow.
The above command should output the system date to a text file located on the Administrator user's desktop named systemdate.txt.
 

ka04W000000Oc7JQAS_0EM4400000029HZ.jpeg

 
3. Create an Update Parameters node, select the parameter created in Step 1, check the "Resolve the value from" check box and make sure the drop down below that check box is set to File. Add the same file path with file name from the node in Step 2 into the New Value section. In this example, that would be the following:
 


C:/users/administrator/desktop/systemdate.txt

 

ka04W000000Oc7JQAS_0EM4400000029Hc.jpeg

 
 
4. Create a Delete Files node that deletes the file. Use the absolute path in front of the file name here as well.
 

ka04W000000Oc7JQAS_0EM4400000029HW.jpeg

 
5. Add a Success or Continue connector from the Execute Application to the Update Parameters node. Add another Success or Continue connector from the Update Parameters node to the Delete Files node.
 

ka04W000000Oc7JQAS_0EM4400000029HY.jpeg

 
If done as specified above, this part of the workflow should pass the results of the Command Line operation to the System Manager parameter.


Comment

0 comments

Details

Knowledge Article

Published:

May 29, 2017

Last Updated:

May 29, 2017