Management API - Command Line Client

Besides the option to develop your own client for the Management API in any arbitrary programming or scripting language, MailStore Service Provider Edition provides a simple to use command line client in the form of the MailStoreManagementCmd.exe executable to be used in simple batch scripts or by backup software to remote control instances.

The syntax of the MailStoreManagementCmd.exe looks as follows:

  MailStoreManagementCmd.exe -s <server> -u <user> -p <password> -t <thumbprint> -c <command> [-param1 <value> -param2 <value> ...]

The below command line parameters are required followed by additional API command parameters if necessary.

Parameter Description
-s IP address or host name of the Management Server to connect to.
-t Thumbprint of the SSL certificate used by the Management Server. Use * to accept any certificate.
-u Username of a MailStore Service Provider Edition Administrator
-p Password of the MailStore Service Provider Edition Administrator
-c API command to be executed.

The output of the executed API command is returned to the standard output (STDOUT) comparable to the HTTP bodies as described in Using the API. Therefore a JSON parser is recommended for further processing of the output.

MailStoreManagementCmd.exe itself exits with error code 0 if no errors occurred, otherwise the exit code 1 is returned.

Examples

  MailStoreManagementCmd.exe -s localhost -u admin -p password -t 46AD1743B61B1F7B4AD3FBB8DC24498953BA3DA7 -c GetEnvironmentInfo
 MailStoreManagementCmd.exe -s localhost -u admin -p password -t 46AD1743B61B1F7B4AD3FBB8DC24498953BA3DA7 -c GetProfiles -instanceID test01 -raw true

You are able to parse the result in the Powershell

(ConvertFrom-Json ([String](.\MailStoreManagementCmd.exe -s localhost -u admin -p password -t 46AD1743B61B1F7B4AD3FBB8DC24498953BA3DA7 -c CreateLicenseRequest))).result.instanceData | where { $_.usedLicenseCount }