There are several ways to include the scripts from the ActionPacks in ScriptRunner. According to best practice, an alternative directory is created for the Sync Script. This way the scripts are always available internally on the latest version.
The scripts to be used can be migrated to the working directory manually or by action with an appropriate ScriptRunner script.
This is how you connect ScriptRunner to the Github repository for the first time:
Install Git for Windows on the ScriptRunner host. You can find instructions onGitHub
Load Sync Script to the script repository on the ScriptRunner host as well as 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.
To make the ActionPack for Exchange available for actions:
Copy the desired scripts or the entire directory of an ActionPack into the ScriptRunner working directory. The scripts will be automatically recognized and tagged by ScriptRunner. Now the scripts are available in ScriptRunner.
Step 2: Configuring Exchange Server with Credentials
To use the scripts from the ActionPack for Exchange in ScriptRunner, you first need to set up an Exchange administration account and the Exchange Server in ScriptRunner. These steps are done in the ScriptRunner Admin App.
Creating the Exchange administrative account:
The Exchange administrator to be configured must have administrative rights for mailboxes, etc. Multiple, different accounts can be entered.
Create the credential in ScriptRunner under “New+” or in the main “Credentials” menu with “Create”.
Then enter the name and password.
Now set the tag “Exchange” and other tags if necessary.
Create an administrative 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 !
Set up Exchange server as target system
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
# additional session options may be necessary depending on the constellation in your environment
# Eg: -Authentication method -SkipNCheck, -SkipRevocationCheck, -SkipCACheck
>Import-PSSession -Session $session
>get-command –module ‚temp_module_name‘
-> in the given example
>get-command –module tmpkc1p04s0.z4c
Example command in PowerShell
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 presets for the action. The action is then configured, can be used and also delegated.
Configuration of an action in the ScriptRunner Admin App
Selecting Exchange Server as target system in the action configuration
https://www.scriptrunner.com/wp-content/uploads/2021/04/scriptrunner-version2020r3.png10001000Frank Kressehttps://www.scriptrunner.com/wp-content/uploads/2018/05/ScriptRunner_Logo_RGB-300x45.pngFrank Kresse2021-04-27 17:19:072021-05-06 13:33:05ScriptRunner 2020R3 – full scope of functions in the portal, multi-attribute queries and more actions for end usersScriptRunner Software GmbH
https://www.scriptrunner.com/wp-content/uploads/2021/03/citrixactionpack.jpg441441Heiko Brenn, Head of International Businesshttps://www.scriptrunner.com/wp-content/uploads/2018/05/ScriptRunner_Logo_RGB-300x45.pngHeiko Brenn, Head of International Business2021-03-11 13:02:162021-03-11 14:46:04ScriptRunner ActionPack for Citrix