Difference between revisions of "Scripting"

[unchecked revision][unchecked revision]
Line 13: Line 13:
  
 
== Preparation ==
 
== Preparation ==
In order to execute Python scripts from our [[Media:MailStoreScripts.zip‎|script package]] your need to install the Python runtime. The Windows Installer of the Python runtime can be downloaded from http://www.python.org. For Linux operating systems please follow the instructions of your distributor's package manager to install the Python runtime.  
+
In order to execute Python scripts from our [[Media:MailStoreScripts.zip‎|script package]] your need to install the Python runtime. The Windows Installer of the Python runtime can be downloaded from http://www.python.org. For Linux operating systems please follow the instructions of your distributor's package manager to install the Python runtime. The API Wrapper is compatible to Python 3.2 and Python 3.3.
  
 
Our [[Media:MailStoreScripts.zip‎|script package]] includes a version of the MailStore Server Administration API Python wrapper. Therefore after downloading the package you just need to extract the content into a directory on your local hard disk.
 
Our [[Media:MailStoreScripts.zip‎|script package]] includes a version of the MailStore Server Administration API Python wrapper. Therefore after downloading the package you just need to extract the content into a directory on your local hard disk.

Revision as of 09:40, 20 December 2013

With the MailStore Server Management Shell as well as the MailStore Server Administration API MailStore Server offers multiple methods of automating tasks by using scripts. In this scripting area we have put together scripts that provide solutions for use-cases we have often been asked for.

This article describes needed steps of preparation as well as how to execute the scripts.

Download the script package

Download the script package and unzip it using your favourite unzip software, then review the documentation below to use the scripts. Note that you will need to modify the scripts to tailor them to your particular environment.

Using Windows Batch Scripts

Before you are able to execute Windows Batch Scripts on the command line cmd.exe, you need to open the script file in a text editor such as Notepad Adjust the configuration variables above the DON'T CHANGE ANYTHING BEYOND THIS LINE line to your local environment. Please take care not to change any single or double quotes.

Using Python Scripts

Preparation

In order to execute Python scripts from our script package your need to install the Python runtime. The Windows Installer of the Python runtime can be downloaded from http://www.python.org. For Linux operating systems please follow the instructions of your distributor's package manager to install the Python runtime. The API Wrapper is compatible to Python 3.2 and Python 3.3.

Our script package includes a version of the MailStore Server Administration API Python wrapper. Therefore after downloading the package you just need to extract the content into a directory on your local hard disk.

Executing Python Scripts

In order to execute Python Scripts you have to open the script file you want to execute with IDLE (shipped with Python's Windows installer) and adjust the configuration section above the line saying DON'T CHANGE ANYTHING BEYOND THIS LINE. Please take care not to change any double or single quotes.

To execute the script, click on Run > Run Module or press the F5-key in IDLE. A new window pops up where you can follow the standard output of the script and see possible execution errors.

Changelog

2013-04-17 New: updateUserNames.py, mergeFolders.py

2013-06-25 Bugfix: MailStoreApi.RebuildStoreIndex was not working properly

2013-09-17 New: check_mailstorelicence.py