MicroStrategy ONE

Executing a Command Manager Script

You can execute Command Manager scripts in the following ways:

  • From the Command Manager graphical interface (see Creating and Executing Scripts)
  • From the Command Manager command line interface (see Using Command Manager from the Command Line)
  • Invoke the Command Manager executable, including necessary parameters such as the script file to run, from the Windows scheduler, Windows command prompt, or other applications such as system management software.

Command Manager Runtime is a lightweight version of Command Manager for bundling with OEM applications. Command Manager Runtime has fewer execution options and supports fewer statements than Command Manager. For more information about Command Manager Runtime, see Using Command Manager with OEM Software.

Command Manager does not automatically lock a project or configuration when it executes statements. To avoid metadata corruption, use the LOCK PROJECT or LOCK CONFIGURATION statements in any Command Manager scripts that make changes to a project or server configuration. For more information about locking and unlocking a project or configuration, see Project and Configuration Locking.

To Execute a Script from the Command Manager Graphical Interface

  1. Start the Command Manager graphical interface:
    • In Windows: From the Windows Start menu, point to All Programs, then MicroStrategy Tools, and then choose Command Manager.
    • In Linux: Browse to the MicroStrategy Home folder, then to the /bin subfolder. Type mstrcmdmgrw and press Enter.
  2. Connect to a project source or Narrowcast Server.
  3. Open the script. (From the File menu, select Open.)
  4. From the Connection menu, select Execute. The script executes.

To Execute a Script from the Command Manager Command Line Interface

For specific command syntax for the command line interface, see the Command Manager Help.

  1. From the command line, type cmdmgr.exe -interactive and press Enter. The Command Manager command line interface opens, in console mode, with an active connection-less project source connection.
  2. Connect to a project source or Narrowcast Server using the CONNECTMSTR or CONNECTNCS command.
  3. To load a script and execute it, type EXECFILE filename, where filename is the name of the script. The script is loaded into the command line interface and executed.

To invoke Command Manager from Another Application

Call the cmdmgr.exe command with the following parameters:

If the project source name, the input file, or an output file contain a space in the name or path, you must enclose the name in double quotes.

Effect

Parameters

Connection (required; choose one)

 

Connect to a project source

If -p is omitted, Command Manager assumes a null password.

-n ProjectSourceName

-u UserName

[-p Password]

Initiate a connection-less project source session

-connlessMSTR

Connect to a Narrowcast Server

If -p or -s are omitted, Command Manager assumes a null password or system prefix.

-w ODBC_DSN

-u UserName

[-p Password]

-d Database

[-s SystemPrefix]

Initiate a connection-less Narrowcast Server session

If -s is omitted, Command Manager assumes a null system prefix.

-connlessNCS

[-d Database]

[-s SystemPrefix]

Script input (required)

 

Specify the script file to be executed

If this parameter is omitted, the Command Manager GUI is launched.

-f InputFile

Script output (optional; choose only one)

Log script results, error messages, and status messages to a single file

-o OutputFile

Log script results, error messages, and status messages to separate files, with default file names of:

CmdMgrResults.log

CmdMgrFail.log

CmdMgrSuccess.log

-break

Log script results, error messages, and status messages to separate files, with specified names

You can omit one or more of these parameters. For example, if you want to log only error messages, use only the -of parameter.

-or ResultsFile

-of FailFile

-os SuccessFile

Script output options (optional)

 

Begin each log file with a header containing information such as the version of Command Manager used

-h

Print instructions in each log file and on the console

This option is ignored if the script is encrypted. For information about encrypted Command Manager scripts, see Encrypting Command Manager Scripts.

-i

If an Intelligence Server error occurred, print the Intelligence Server error code and the Command Manager exit code in each log file and on the console

-e

Display script output on the console

-showoutput

Save the results of the script in an CSV file

-csv CSVFile

Save the results of the script in an XML file

-xml XMLFile

Omit hidden objects in the script results. Hidden objects are MicroStrategy metadata objects whose HIDDEN property is set.

-suppresshidden

Execution options (optional)

 

Halt script execution on critical errors (see Handling Execution Errors)

-stoponerror

A full list of parameters can also be accessed from a command prompt by entering cmdmgr.exe -help.

By default, the executable is installed in the following directory:

Program Files (x86)\MicroStrategy\Command Manager