Difference between revisions of "MailStore Server Management Shell"

[unchecked revision][checked revision]
(45 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
The management shell is useful when no graphical user interface is available (e.g. if using telnet or ssh) or for the integration of scripts (e.g. batch files) that are executed either manually or automatically.
 
The management shell is useful when no graphical user interface is available (e.g. if using telnet or ssh) or for the integration of scripts (e.g. batch files) that are executed either manually or automatically.
  
= Option 1: Starting the Management Shell in MailStore Client =
+
Beside the client-side commands, the Management Shell also offers access to server-side commands of the [[Administration API - Using the API|MailStore Server Administration API]]. Output of server-side commands is in JSON format.
 
 
The management shell can be started directly from MailStore: Log on to MailStore Client as administrator and click on Management Shell.
 
  
 +
== Starting the Management Shell in MailStore Client ==
 +
The management shell can be started directly from MailStore: Log on to MailStore Client as administrator and click on ''Administrative Tools > Management API > Command Prompt''.
 
[[File:tech_mscmd_01.png|center|450px]]
 
[[File:tech_mscmd_01.png|center|450px]]
 +
The font size can be adjusted by holding the Ctrl key and using the mouse wheel or pressing + and -. Holding down the Ctrl key and pressing 0 resets the font size.
  
= Option 2: Starting the Management Shell with MailStoreCmd.exe =
+
== Using MailStoreCmd.exe in Non-Interactive Mode ==
 +
In non-interactive mode, the management shell logs on with the access data passed, executes the command passed, and automatically terminates upon execution. If the login and the execution of the command were successful, the exit code (ERRORLEVEL) of the process is set to 0 (zero), otherwise it is set to any value other than 0. ''MailStoreCmd.exe'' can be found in the installation directory of MailStore Server. ''MailStoreCmdSilent.exe'' does the same, but does not open a console window.
  
The command line client can be started in interactive mode by executing MailStoreCmd.exe without any parameters. After successful login, MailStore is ready to receive commands.
+
Login credentials for your installation can be found in the scheduled task of an archiving profile of the type ''E-Mail Programs'' or ''E-Mail Files''.
  
Enter exit to log off and exit the management shell.
+
The syntax of the ''MailStoreCmd.exe'' looks as follows:
  
[[File:tech_mscmd_02.png|center|450px]]
+
  MailStoreCmd.exe -h <server> -u <user> -p <password> --pvk3 <thumbprint> -c <command> [--param1=<value> --param2=<value> ...]
  
= Using MailStoreCmd.exe in Non-Interactive Mode =
+
The below command line parameters are required followed by additional API command parameters if necessary.
  
In non-interactive mode, the management shell logs on with the access data passed, executes the command passed, and automatically terminates upon execution. If the login and the execution of the command were successful, the exit code (ERRORLEVEL) of the process is set to 0 (zero), otherwise it is set to any value other than 0.
+
{| class="wikitable"
 +
! width=100px | Parameter
 +
! width=100% | Description
 +
|-
 +
| <tt>-h</tt>
 +
|The machine name of the MailStore server to which code>MailStoreCmd.exe</code> is to connect.
 +
|-
 +
| <tt>--pvk3</tt>
 +
| The (optional) Public Key Fingerprint, which guarantees the identity of MailStore Server.
 +
|-
 +
| <tt>-u</tt>
 +
| User name
 +
|-
 +
| <tt>-p</tt>
 +
| Password
 +
|-
 +
| <tt>--pc</tt>
 +
| Alternative to <tt>-p</tt>, encrypted password.
 +
|-
 +
| <tt>--nologo</tt>
 +
| Optional. Prevents the logo from being displayed.
 +
|-
 +
| <tt>--o</tt>
 +
| Optional. Redirects the output to a given file. When this parameter is given, no output is sent to the console.
 +
|-
 +
| <tt>-c</tt>
 +
| The actual command follows (non-interactive mode).
 +
|}
  
To use the non-interactive mode, pass the parameters as follows:
+
== Command Overview ==
 +
Find a list of all client side commands below. An overview of all available server side commands can be found under [[Administration API - Function Reference|Function Reference]].
  
MailStoreCmd.exe --h="localhost" --pkv3="23:18:06:3f:24:7d:f3:83" --u="admin" --p="admin" -c '''Actual Command and Parameter'''
+
  clear
  
The following is a description of the parameters:
+
Clears the texts currently displayed improving visibility.
 
 
'''--h="localhost"'''
 
The machine name of the MailStore server to which MailStoreCmd.exe is to connect.
 
  
'''--pkv3="..."'''
+
  debug-conn
The (optional) Public Key Fingerprint, which guarantees the identity of MailStore Server.
 
  
'''--u="admin"'''
+
Activates debug protocol for IMAP and HTTP connections during archiving for the running MailStore Client process.
User name.
 
  
'''--p="admin"'''
+
  debuglog-browse
Password.
 
  
'''-c'''
+
Opens the file explorer and shows MailStore's ''Debug Log'' directory.
The actual command follows (non-interactive mode).
 
  
= Command Overview =
+
  debuglog-enable,  debuglog-disable
  
clear
+
Activates or deactivates the global debug protocol (within computer scope).
  
Clears the texts currently displayed improving visibility.
+
  exejcfg [--d]
  
  help
+
Enables envelope journaling on Exchange 2003 servers. When the parameter --d is given, envelope journaling will be disabled. This command must be executed from a domain joined computer.
  
Displays a list of all available commands and their parameters.
+
  export-execute [--name=<profilename>] [--id=<profileid>] [--verbose] [--[property]="value"]
  
debuglog-enable, debuglog-browse, debuglog-disable
+
Executes an export profile. Following parameters are supported:
  
Activates, displays or deactivates the global debug protocol (within computer scope).
+
{| width=80% |
 +
|-
 +
| width="20%" | <code>--name</code> <nowiki>|</nowiki> <code>--id</code>
 +
| name or ID of the export profile to execute
 +
|-
 +
| <code>--verbose</code>
 +
| activates a detailed status display on the console
 +
|-
 +
| <code>--[property]</code>
 +
| Overwrites the given property of a profile. The internal properties can be displayed, by selecting an export profile and press <code>CTRL + SHIFT + P</code>. The name of the property has to be in brackets. Multiple properties can be modified by repeating the parameter.
 +
|}
  
export-list
+
  export-list
  
 
Displays a list of all existing export profiles (ID and profile name).
 
Displays a list of all existing export profiles (ID and profile name).
  
export-execute [--name=<profilename>] [--id=<profileid>] [--verbose]
+
  help
  
Executes the export profile with the name or the ID specified (only one of these parameters is required). The parameter --verbose activates a detailed status display on the console.
+
Displays a list of all available commands and their parameters.
  
import-list [--user=<username>]
+
  import-execute [--name=<profilename>] [--id=<profileid>] [--verbose] [--user=<username>] [--[property]="value"]
  
Displays a list of all existing archiving profiles (ID and profile name).
+
Executes the archiving profile. Following parameters are supported:
  
import-execute [--name=<profilename>] [--id=<profileid>] [--verbose] [--user=<username>]
+
{| width=80% |
 +
|-
 +
| width="20%" |<code>--name</code> <nowiki>|</nowiki> <code>--id</code>
 +
| name or ID of the import profile to execute
 +
|-
 +
| <code>--verbose</code>
 +
| activates a detailed status display on the console
 +
|-
 +
| <code>--user</code>
 +
| user archive to store archived emails
 +
|-
 +
| <code>--[property]</code>
 +
| Overwrites the given property of a profile. The internal properties can be displayed, by selecting an archiving profile and press <code>CTRL + SHIFT + P</code>. The name of the property has to be in brackets. Multiple properties can be modified by repeating the parameter.
 +
|}
  
Executes the archiving profile with the name or the ID specified (only one of these parameters is required). The parameter --verbose activates a detailed status display on the console.
+
  import-list [--user=<username>]
  
filegroup-attach --directory=<directory>
+
Displays a list of all existing archiving profiles (ID and profile name).
 
 
With this command a file group, which has been removed from MailStore using filegroup-detach, can be reattached to MailStore.
 
 
 
filegroup-detach --gid=<filegroupid>
 
 
 
In Administrative Tools under Storage Locations, the status of a file group can be set to inactivate. The file group (along with the emails it contains) is no longer available until it is reactivated but remains in the list of existing file groups. By using the command filegroup-detach, a file group is completely removed from MailStore but physically remains on the hard drive.
 
 
 
process-info
 
  
Provides information about the MailStore-Windows process.
+
  livelog-client-disable,  livelog-client-enable,  livelog-server-disable,  livelog-server-enable
  
rpc-info
+
Activates or deactivates the live debug protocol of MailStore Server or MailStore Client. The live protocol can be viewed with Sysinternal's DebugView. DebugView must be started with elevated privileges and it must be configured to capture ''Global Win 32'' events.
  
Provides information about the connection with the MailStore Server process.
+
  store-setprop --name=<name> [--value=<value>]
  
statistics-refresh
+
Changes the value of a global property
  
Recalculates all statistics.
+
{| width=100% |
 +
|-
 +
| scope="col" width="20%" | <code>--name</code>
 +
| Name of the global property
 +
|-
 +
| <code>--value</code>
 +
| Value of the global property
 +
|}
  
maintain-db [--gid=<filegroupid>] --command=[backup-restore|sweep]
+
Following global properties are supported:
  
maintain-ix --gid=<filegroupid> --command=[list|optimize|reload|verify|] [--ixid=<indexid>]
+
{| width="100%" border="0" cellpadding="0" cellspacing="0"
 +
|-
 +
! scope="col" width="20%" bgcolor="#cccccc" | Name
 +
! scope="col" bgcolor="#cccccc" | Version
 +
! scope="col" bgcolor="#cccccc" | Values
 +
! scope="col" bgcolor="#cccccc" | Default
 +
|-
 +
| scope="col" width="20%" align="left" valign="top" | public.arcclient.skipMimeContentConversionFailed
 +
| align="center" valign="top" | 8
 +
| ''true'' = Exchange ''MimeContentConversionFailed'' errors are ignored and not handled as an archiving error.<br/><br/>
 +
''false'' = Exchange ''MimeContentConversionFailed'' errors are handled as archiving errors.
 +
| align="center" valign="top" | false
 +
|-
 +
| scope="col" width="20%" align="left" valign="top" | public.arcclient.skipVirusDetected
 +
| align="center" valign="top" | 8.1
 +
| ''true'' = Exchange ''ErrorVirusDetected'' errors are ignored and not handled as an archiving error.<br/><br/>  
 +
''false'' = Exchange ''ErrorVirusDetected'' errors are handled as archiving errors.
 +
| align="center" valign="top" | false
 +
|-
 +
| scope="col" width="20%" align="left" valign="top" | public.arcclient.skipEwsErrorItemNotFound
 +
| align="center" valign="top" | 10
 +
| ''true'' = Exchange ''ErrorItemNotFound'' errors are ignored and not handled as an archiving error.<br/><br/>
 +
''false'' = Exchange ''ErrorItemNotFound'' errors are handled as archiving errors.
 +
| align="center" valign="top" | false
 +
|}
  
folder-reindex [--folder=<userfolder>] --gid=<filegroupid>
+
  user-list
  
filegroup-verify --gid=<filegroupid>
+
Display list of users.
  
Information about these commands can be found in chapter Maintenance and Repair.
 
 
[[de:MailStore_Server_Management_Shell]]
 
[[de:MailStore_Server_Management_Shell]]
 +
[[en:MailStore_Server_Management_Shell]]

Revision as of 10:36, 23 February 2017

Many instructions available in the graphical user interface of MailStore Client can also be executed using MailStore's management shell, a command line client which is automatically included when installing MailStore Server and MailStore Client.

The management shell is useful when no graphical user interface is available (e.g. if using telnet or ssh) or for the integration of scripts (e.g. batch files) that are executed either manually or automatically.

Beside the client-side commands, the Management Shell also offers access to server-side commands of the MailStore Server Administration API. Output of server-side commands is in JSON format.

Starting the Management Shell in MailStore Client

The management shell can be started directly from MailStore: Log on to MailStore Client as administrator and click on Administrative Tools > Management API > Command Prompt.

Tech mscmd 01.png

The font size can be adjusted by holding the Ctrl key and using the mouse wheel or pressing + and -. Holding down the Ctrl key and pressing 0 resets the font size.

Using MailStoreCmd.exe in Non-Interactive Mode

In non-interactive mode, the management shell logs on with the access data passed, executes the command passed, and automatically terminates upon execution. If the login and the execution of the command were successful, the exit code (ERRORLEVEL) of the process is set to 0 (zero), otherwise it is set to any value other than 0. MailStoreCmd.exe can be found in the installation directory of MailStore Server. MailStoreCmdSilent.exe does the same, but does not open a console window.

Login credentials for your installation can be found in the scheduled task of an archiving profile of the type E-Mail Programs or E-Mail Files.

The syntax of the MailStoreCmd.exe looks as follows:

  MailStoreCmd.exe -h <server> -u <user> -p <password> --pvk3 <thumbprint> -c <command> [--param1=<value> --param2=<value> ...]

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

Parameter Description
-h The machine name of the MailStore server to which code>MailStoreCmd.exe is to connect.
--pvk3 The (optional) Public Key Fingerprint, which guarantees the identity of MailStore Server.
-u User name
-p Password
--pc Alternative to -p, encrypted password.
--nologo Optional. Prevents the logo from being displayed.
--o Optional. Redirects the output to a given file. When this parameter is given, no output is sent to the console.
-c The actual command follows (non-interactive mode).

Command Overview

Find a list of all client side commands below. An overview of all available server side commands can be found under Function Reference.

 clear

Clears the texts currently displayed improving visibility.

 debug-conn

Activates debug protocol for IMAP and HTTP connections during archiving for the running MailStore Client process.

 debuglog-browse

Opens the file explorer and shows MailStore's Debug Log directory.

 debuglog-enable,  debuglog-disable

Activates or deactivates the global debug protocol (within computer scope).

 exejcfg [--d]

Enables envelope journaling on Exchange 2003 servers. When the parameter --d is given, envelope journaling will be disabled. This command must be executed from a domain joined computer.

 export-execute [--name=<profilename>] [--id=<profileid>] [--verbose] [--[property]="value"]

Executes an export profile. Following parameters are supported:

--name | --id name or ID of the export profile to execute
--verbose activates a detailed status display on the console
--[property] Overwrites the given property of a profile. The internal properties can be displayed, by selecting an export profile and press CTRL + SHIFT + P. The name of the property has to be in brackets. Multiple properties can be modified by repeating the parameter.
 export-list

Displays a list of all existing export profiles (ID and profile name).

 help

Displays a list of all available commands and their parameters.

 import-execute [--name=<profilename>] [--id=<profileid>] [--verbose] [--user=<username>] [--[property]="value"]

Executes the archiving profile. Following parameters are supported:

--name | --id name or ID of the import profile to execute
--verbose activates a detailed status display on the console
--user user archive to store archived emails
--[property] Overwrites the given property of a profile. The internal properties can be displayed, by selecting an archiving profile and press CTRL + SHIFT + P. The name of the property has to be in brackets. Multiple properties can be modified by repeating the parameter.
 import-list [--user=<username>]

Displays a list of all existing archiving profiles (ID and profile name).

 livelog-client-disable,  livelog-client-enable,  livelog-server-disable,  livelog-server-enable

Activates or deactivates the live debug protocol of MailStore Server or MailStore Client. The live protocol can be viewed with Sysinternal's DebugView. DebugView must be started with elevated privileges and it must be configured to capture Global Win 32 events.

 store-setprop --name=<name> [--value=<value>]

Changes the value of a global property

--name Name of the global property
--value Value of the global property

Following global properties are supported:

Name Version Values Default
public.arcclient.skipMimeContentConversionFailed 8 true = Exchange MimeContentConversionFailed errors are ignored and not handled as an archiving error.

false = Exchange MimeContentConversionFailed errors are handled as archiving errors.

false
public.arcclient.skipVirusDetected 8.1 true = Exchange ErrorVirusDetected errors are ignored and not handled as an archiving error.

false = Exchange ErrorVirusDetected errors are handled as archiving errors.

false
public.arcclient.skipEwsErrorItemNotFound 10 true = Exchange ErrorItemNotFound errors are ignored and not handled as an archiving error.

false = Exchange ErrorItemNotFound errors are handled as archiving errors.

false
 user-list

Display list of users.