MicroStrategy ONE

Executing a script from the command line

Command Manager supports command line execution so that administrators can execute unattended scripts. This feature can also be combined with various other resources such as the Windows scheduler, integrated with maintenance batch files, integrated with systems management software, as well as executed from within a relational database via stored procedures.

You can log on to a project source name or Narrowcast Server using Windows authentication to perform any Command Manager function. When you run Command Manager using the command line, you must provide a user name regardless of whether the project source or Narrowcast Server uses Windows authentication. However, if it uses Windows authentication, the user name passed to Command Manager is ignored and the Windows security credentials are used instead.

If you create a batch file to execute a Command Manager script from the command line and you are using standard MicroStrategy authentication, the password for the Project Source or Narrowcast Server login must be stored in plaintext in the batch file. This creates a security risk, since anyone who can view the batch file has access to a MicroStrategy administrator login and password. To avoid this security risk, MicroStrategy recommends you include a CONNECT SERVER statement in the script to connect to a project source or Narrowcast Server, encrypt the script, and use a connection-less session to execute the script. In this way the password is only present in the encrypted script.

The command line execution mode has a number of different command line options. These options vary depending on whether the target metadata is a project source or a Narrowcast Server. For a list of project source command line options, see Command line syntax.

When a script that has been executed from the command line ends, an exit code is displayed in the command prompt window. If the script ends unexpectedly, this exit code can help you find the cause of the error.

To execute a script from the command line

Call the Command Manager executable, cmdmgr.exe, with the parameters listed in Command line syntax. By default, this executable is located in C:\Program Files\MicroStrategy\Command Manager.

Related Topics

Command line syntax

Encrypting a script

Executing a script

Command line exit codes

Using Command Manager with OEM software