Only 3 steps are necessary to use the scripts from the ActionPack for Exchange in ScriptRunner:
Embed ActionPack scripts into ScriptRunner
Configuring Exchange Server as a Target System with Administrative Access
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:
Install Git for Windows on the ScriptRunner host. You will find more information on this on GitHub
Download Sync Script from GitHub.
Load Sync Script into the Script Repository on the ScriptRunner Host and create a GitHub User under Credentials.
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.
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.
Create the credential in ScriptRunner under “New+” or in the main menu “Credentials” with “Create”.
Then enter your name and password.
Now set the tag “Exchange” and if necessary further tags.
CreateAdministrative Exchange Account
Set up the Exchange Server as the target system:
Create the Exchange Server in ScriptRunner under “New+” or in the main menu “Targets” with “Create”.
Now enter the FQDN of the server and select the Credential that has been set up. Also assign the “Exchange” tag.
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.
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
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:
Open PowerShell on ScriptRunner Host as an administrator.
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
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:
In ScriptRunner, select the Scripts main menu. Here you can find the corresponding Exchange Scripts.
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.
The target selection also suggests the Exchange Server for the action, if it was tagged with “Exchange”.
Optionally, you can now make various settings and presettings for the action. The action is then configured, can be used and also delegated.
https://support.scriptrunner.com/wp-content/uploads/2019/02/Action_Packs-725x375-1.png318400Frank Kresse, Head of Productshttps://support.scriptrunner.com/wp-content/uploads/2018/02/ScriptRunner_logo.pngFrank Kresse, Head of Products2018-08-20 16:00:162020-02-21 12:53:16ScriptRunner ActionPack for Windows System Management
https://support.scriptrunner.com/wp-content/uploads/2017/07/Action-Packs-t.png375725Frank Kresse, Head of Productshttps://support.scriptrunner.com/wp-content/uploads/2018/02/ScriptRunner_logo.pngFrank Kresse, Head of Products2017-07-14 20:04:142020-02-21 13:24:24ScriptRunner ActionPacks for PowerShell – free script collections
https://support.scriptrunner.com/wp-content/uploads/2016/09/18.png266625Frank Kresse, Head of Productshttps://support.scriptrunner.com/wp-content/uploads/2018/02/ScriptRunner_logo.pngFrank Kresse, Head of Products2016-09-23 17:04:052020-02-21 13:29:27Technical guide: ScriptRunner ActionPack for Automic