Customising the Remote Console (

Updates on work in progress and information on new features.

Customising the Remote Console (

Postby Elric Pedder » Fri May 04th, 2012 10:22pm

This build introduces a powerful feature to the Remote Console: customisation through scripts. Every piece of configuration data available to the Remote Console is provided through the Remote API. Access to the database through the Remote API is in development but once that is complete it will be possible to do anything that you see in the Remote Console through remote scripts. Now you can also trigger those scripts by adding commands to the context menus and the main menu of the console.

Currently selected objects in the Console

In this build we also introduce the Selection object. This object has only two methods: Get(index) and Count() which access the current selection. Get returns each currently selected object which is a list of properties and includes the properties of the currently selected node. You can retrieve a property with the Read(name) method. If you select an object and then go to Tools | Execute Script you can inspect the properties in the Selection tab at the bottom of the window. This is how you can find out what properties are exposed.

Console Extension Scripts

Console Extension Scripts are managed in the Console tab of the Scripts and Templates dialogue in the Options menu.

Console Extension Scripts Tab
console-scripts.png (36.64 KiB) Viewed 5920 times

However, the extensions are not actually part of the Mailtraq server that is currently being managed. Rather, the extensions exist in the .msc file which is a saved console state. A .msc file can be used to connect to multiple Mailtraq servers and the extensions will be available to any of them.

This raises a very important point that you are sure to run into: even if you save the changes to the extension or the associated script they are not written to disk until you save the console state (as an .msc file). Because the process of saving the state is handled by the Microsoft Management Console, we can't automate it for you.

Saving the Console
console-saveas.png (19.01 KiB) Viewed 5920 times

Saving the Console is a very useful tool and it allows you to create highly customised management tools. You can save a console that provides a very limited view of the remote system and embed the credentials so that an individual's access can be controlled.

Example Extension

To better explain the extension concept an example will be used: creating an extension to move a message into a folder named "Archive". To begin, go to the Console tab and click Add.

Console Script Properties
console-script-props.png (61.48 KiB) Viewed 5920 times

In the Properties dialogue fill in the name and description of the extension and on the Menu tab you determine where in the Console it will appear. If you assign the extension to a Node then right clicking on an object of that type in either the tree view on the left or the results pane on the right will display the command in the Tasks sub-menu. Selecting the Result list for node option means that if the specified node type is selected in the tree view, then the extension appears when you right-click on a selection in the results pane regardless of the type of object you select there.

Next you will need to click on Edit Script to actually write the script to attach.

Custom Script
movetofolder-script.png (136.13 KiB) Viewed 5920 times

Now you save all the changes and close the properties dialogues. Note: the menu structure is determined when you load a console so in order for the extension to appear you must save the console and then load it again. The same applies if you change the name or menu item placement.

Using the Extension

Now when you select a message in a mailbox you will be able to see the new command in the context menu.

Move to Archive Extension
console-script-movearch.png (46.89 KiB) Viewed 5920 times

We are still documenting the Remote API and the necessary supporting infrastructure so in the mean time if you are interested in writing an extension just ask for help on the forums.
Mailtraq Development and Escalation Support
Novitraq Incorporated
User avatar
Elric Pedder
Mailtraq Escalation Support
Posts: 2675
Joined: Tue Nov 23rd, 2004 1:16pm
Location: Montreal, Canada

Return to Mailtraq News

Who is online

Users browsing this forum: No registered users and 1 guest