How to set up the Action Pack for Exchange in just 3 steps

Author: | Reading time: 3 minutes | Category: Action Pack

Action Pack Exchange einrichten , ScriptRunner PowerShell, Automation

This article has been translated automatically.

Exchange teams have a lot of routine work to do every day. With the ScriptRunner ActionPack for Exchange, these activities can be quickly and securely automated and delegated.

Only 3 steps are necessary to use the scripts from the ActionPack for Exchange in ScriptRunner:

  1. Embed ActionPack scripts into ScriptRunner
  2. Configuring Exchange Server as a Target System with Administrative Access
  3. Checking the Connection to the Exchange Server

Actions can then be set up and delegated with the scripts from the collection.

Step 1: Integrate ActionPack scripts into ScriptRunner

The ScriptRunner ActionPacks are made available on the ScriptRunner GitHub repository, regularly updated with additional scripts and topics. There are several ways to integrate the scripts from the ActionPacks into ScriptRunner. After the best practice an alternative directory for the sync script will be created. Thus the scripts are always available internally on the newest conditions. The scripts to be used can be migrated to the working directory manually or by action with an appropriate ScriptRunner script.

How to connect ScriptRunner to the Github repository for the first time:

  1. Install Git for Windows on the ScriptRunner host. You will find more information on this on GitHub
  2. Download Sync Script from GitHub.
  3. Load Sync Script into the Script Repository on the ScriptRunner Host and create a GitHub User under Credentials.
  4. Set up a GitSync action on ScriptRunner for Clone mode and run it for the first time. The ActionPacks are created in the specified directory.

Update scripts:

Configure a scheduled action with Pull mode. This will automatically update the scripts in the specified target directory.

How to make the ActionPack for Exchange available for actions:

Copy the scripts or the entire directory of an ActionPack into the ScriptRunner working directory. The scripts are automatically recognized and tagged by ScriptRunner. The scripts are now available in ScriptRunner.

Step 2: Configure Exchange Server with Credentials

To use the scripts from the ActionPack for Exchange in ScriptRunner, you must first create an Exchange Administration account and the Exchange Server in ScriptRunner. These steps are done in the ScriptRunner Admin App.

Create the administrative Exchange account:

The Exchange administrator to be configured must have administration rights for mailboxes etc. . Several, different accounts can be entered.

  1. Create the credential in ScriptRunner under “New+” or in the main menu “Credentials” with “Create”.
  2. Then enter your name and password.
  3. Now set the tag “Exchange” and if necessary further tags.
CreateAdministrative Exchange Account

CreateAdministrative Exchange Account

Set up the Exchange Server as the target system:

  1. Create the Exchange Server in ScriptRunner under “New+” or in the main menu “Targets” with “Create”.
  2. Now enter the FQDN of the server and select the Credential that has been set up. Also assign the “Exchange” tag.
  3. Then, on the PS Remoting Settings tab, specify the Exchange PowerShell target type. This selection causes the PowerShell connection not to be established via Remote Management Service by default, but to the Exchange Shell via IIS.
  4. Finally, enable the Implicit PowerShell Remoting option. This selection makes the Exchange Shell directly available on the ScriptRunner host. This means that no changes need to be made to the Powershell settings on the Exchange Server.

IMPORTANT: For error messages, check the authentication method and set it accordingly with the second option “Use a non-default authentication method”. Depending on the domain constellation Kerberos, Negotiate or another may be necessary !

ConfigureExchange Server connection

ConfigureExchange Server connection

Simply activate the implicit remoting. Additional session options such as -SkipNCheck, -SkipRevocationCheck, -SkipCACheck must be entered in the bottom option field. A switch option must be assigned the value 1. An entry of options would then look like this:


Step 3: Check connection to Exchange server manually

To ensure that a connection to Exchange server can be established, a check is performed.

This is how the connection to the Exchange Server is checked:

  1. Open PowerShell on ScriptRunner Host as an administrator.
  2. Execute the following command sequence:
>$pw = ConvertTo-SecureString -String ‘password' -AsPlainText -Force >$cred = New-Object -TypeName pscredential -ArgumentList ‘account',$pw >$session=new-pssession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchangeserver.fqdn/powershell/ -Credential $cred # es können je nach Konstellation in Ihrer Umgebung weitere Session-Optionen notwendig sein # Bsp: -Authenticationmethod -SkipNCheck, -SkipRevocationCheck, -SkipCACheck>Import-PSSession -Session $session >get-command –module ‚temp_module_name‘ -> hier im Beispiel >get-command –module tmpkc1p04s0.z4c

Action Pack Exchange

Configure sample command in the PowerShell actions with the scripts from the ActionPack. The connection to the Exchange server works, the setup is complete and actions can now be configured and executed.

Set Up Actions:

  1. In ScriptRunner, select the Scripts main menu. Here you can find the corresponding Exchange Scripts.
  2. Now select a desired script and create a new action. Since the tags for the scripts are automatically created from the directory names, they do not have to be configured separately. In this example, the tag “Exchange” and “Mailboxes” are preset.
  3. The target selection also suggests the Exchange Server for the action, if it was tagged with “Exchange”.
  4. Optionally, you can now make various settings and presettings for the action. The action is then configured, can be used and also delegated.

SelectExchange Server as target system

SelectExchange Server as target system

Are you interested in the topic Exchange Administration with the ScriptRunner ActionPack? More information can be found in our webinar recording Effectively Design and Securely Delegate Exchange Administration with PowerShell and ScriptRunner ActionPack“!

You might also be interested in these posts:

Action Packs. ScriptRunner PowerShell Scripts
ScriptRunner Action Packs, PowerShell-Scriptsammlungen