Chat now with support
Chat with Support

Active Roles 7.4.1 - Administration Guide

Introduction About Active Roles Getting Started Rule-based Administrative Views Role-based Administration
Access Templates as administrative roles Access Template management tasks Examples of use Deployment considerations Windows claims-based Access Rules
Rule-based AutoProvisioning and Deprovisioning
About Policy Objects Policy Object management tasks Policy configuration tasks
Property Generation and Validation User Logon Name Generation Group Membership AutoProvisioning E-mail Alias Generation Exchange Mailbox AutoProvisioning AutoProvisioning for SaaS products OneDrive Provisioning Home Folder AutoProvisioning Script Execution Office 365 License Management Office 365 Roles Management User Account Deprovisioning Office 365 Licenses Retention Group Membership Removal Exchange Mailbox Deprovisioning Home Folder Deprovisioning User Account Relocation User Account Permanent Deletion Group Object Deprovisioning Group Object Relocation Group Object Permanent Deletion Notification Distribution Report Distribution
Deployment considerations Checking for policy compliance Deprovisioning users or groups Restoring deprovisioned users or groups Container Deletion Prevention policy Picture management rules Policy extensions
Understanding workflow Workflow activities overview Configuring a workflow
Creating a workflow definition Configuring workflow start conditions Configuring workflow parameters Adding activities to a workflow Configuring an Approval activity Configuring a Notification activity Configuring a Script activity Configuring an If-Else activity Configuring a Stop/Break activity Configuring an Add Report Section activity Configuring a Search activity Configuring CRUD activities Configuring a Save Object Properties activity Configuring a Modify Requested Changes activity Enabling or disabling an activity Enabling or disabling a workflow Using the initialization script
Example: Approval workflow E-mail based approval Automation workflow Activity extensions
Temporal Group Memberships Group Family Dynamic Groups Active Roles Reporting Management History
Understanding Management History Management History configuration Viewing change history
Workflow activity report sections Policy report items Active Roles internal policy report items
Examining user activity
Entitlement Profile Recycle Bin AD LDS Data Management One Identity Starling Management One Identity Starling Two-factor Authentication for Active Roles Managing One Identity Starling Connect Azure_Overview
Config ARS to Manage Hybrid AD Objects Managing Hybrid AD Users Office 365 roles management for hybrid environment users Managing Office 365 Contacts Managing Hybrid AD Groups Managing Azure O365 or Unified Groups
Managing Configuration of Active Roles
Connecting to the Administration Service Adding and removing managed domains Using unmanaged domains Evaluating product usage Creating and using virtual attributes Examining client sessions Monitoring performance Customizing the console Using Configuration Center Changing the Active Roles Admin account Enabling or disabling diagnostic logs Active Roles Log Viewer
SQL Server Replication Appendix A: Using regular expressions Appendix B: Administrative Template Appendix C: Communication ports Appendix D: Active Roles and supported Azure environments Appendix E: Enabling delegation for Federated Authentication

Office 365 automation workflow

This section contains information on automation workflow enhancements that enable you to add Azure or Office 365 modules in PowerShell and run the Office 365 services such as Skype for Business, Azure AD, Azure RM, Az, and Sharepoint Powershell scripts within existing Active Roles workflows.

As part of creating automation workflow, a new activity O365ScriptExecutionConfiguration is added to fetch the already configured tenant details. However, if required, you can override Office 365 script execution activity by editing the O365 User and O365 Password workflow parameters by double click on the O365ScriptExecutionConfiguration activity.

Pre-Requisites to run the Office 365 workflow scripts

The following modules must be installed and available on the system running Active Roles to run the Office 365 powershell script execution activity.

  • Azure Resource Manager (AzureRM)
  • Azure Active Directory (Azure AD)
  • Azure PowerShell Az
  • Skype for Business
  • SharePoint


  • AzureRM and Az modules cannot be imported at the same time in the same runspace. You must remove one module before importing the other. For more information, refer Microsoft document on importing and executing the Az and AzureRM commands.
  • To run a Remote Mailbox sample script, on-premises exchange must be available.

These modules must be to be installed to make the import and connect the module and execute the powershell script.

Install modules azurerm, azuread, az, skype for business and Sharepoint , for exchange online is connected to online poweshell hence should not be blocked and network connectivity is available

Creating an Office 365 automation workflow definition

To create an Office 365 automation workflow definition

  1. In the Active Roles console tree, expand Configuration | Policies, right-click Workflow, and select New | Workflow.
  2. Follow the steps in the New Workflow wizard:
    1. On the Name and Description page, type in a name and, optionally, a description for the new workflow.
    2. On the Workflow Type page, under This workflow is intended to start, click On user demand or on a scheduled basis (automation workflow).
    3. On the Completion page, click Finish.
  3. From the tool box within the workflow, select O365ScriptExecutionConfiguration.

  4. From the within the workflow, select the Script activity and configure the script activity to point to the powershell script and function to execute.

    NOTE: The string or command entered in the API O365ExecuteScriptCmd must be well formed and complete for the workflow to run successfully.

Sample Office 365 workflow scripts

$context.O365ImportModules(array of modules)

This script enables the multiple modules specified in the array to be loaded and creates a connection to the modules with the login details retrieved through O365ScriptExecutionConfiguration activity. The O365 User and O365 Password parameters that are configured earlier within workflow are used.


$array = @(“MSOnline”, “Lync”)


$context.O365ImportModule (module)

This enables the single module specified in the script to be loaded.


$context.O365ImportModule(“AzureRm) #latest version azureRm is imported

$context.O365ImportModule(“AzureRm, 4) #latest version azureRm version 4 is imported

$context.O365ExecuteScriptCmd(string/cmd )

Passing any string or command specified in the script will execute and return the results as PSObject.


This script disconnects the PSSessions and removes the modules from the PowerShell pool, and allows to import new modules again.

Example Powershell script_1:

#Get a list of disabled users and Directory Roles available

$_usersinroles= @()

$_default_log = "C:\temp\Roles.csv"


$context.O365ExecuteScriptCmd("get-azureaduser -filter 'accountEnabled eq false'" +" | Export-Csv " +"c:\temp\DisabledUsers.csv" +" -NoTypeInformation")

$context.O365ExecuteScriptCmd("Get-AzureADDirectoryRole | Export-csv "+$_default_log )

$context.O365ConnectSharePoint(<sharepoint url>)

This API enables the connection to the specified Sharepoint link.

Example Powershell script:

$context.O365ImportModule(“sharepoint”) # imports the sharepoint module make sure the sharepoint is installed and is able to import

$context.O365ConnectSharePoint("") #makes the connection Connect-SPOService with already configured tenant details or overridden tenant details

$context.O365ExecuteScriptCmd("Get-SPOUser -site ''" +" | Export-Csv " +"c:\temp\SharePointUsers.csv" +" -NoTypeInformation") #exports the sharepoint users


NOTE: Scripts for multi-factor authentication(MFA) work only for Global Administrative Privilege accounts. To enable MFA for Azure Users, the administrator must have a Global Privilege account.


Activity extensions

In Active Roles, administrators can configure workflow activities of the pre-defined types that are installed with Active Roles. By default, the list of activities in the Workflow Designer contains only the pre-defined activity types, such as Approval Activity or Notification Activity. It is possible to extend the list by adding new types of activity.

Each activity type determines a certain workflow action (for example, originating an approval task or notification) together with a collection of activity parameters to configure the workflow action (for example, parameters that specify the approvers or notification recipients). Active Roles builds upon this concept, providing the ability to implement and deploy custom types of workflow activity. It enables custom activity types to be created as necessary, and listed in the Workflow Designer along with the pre-defined activity types, allowing administrators to configure workflow activities that perform custom actions determined by those new types of workflow activity.

Active Roles allows the creation of custom activities based on the Script Activity built-in activity type. However, creating and configuring a script activity from scratch can be time-consuming. Custom activity types provide a way to mitigate this overhead. Once a custom activity type is deployed that points to a particular script, administrators can easily configure and apply workflow activities of that type, having those activities perform the actions determined by the script. The activity script also defines the activity parameters specific to the activity type.

Custom activity types provide an extensible mechanism for deploying custom workflow activities. This capability is implemented by using the Policy Type object class. Policy Type objects can be created by using the Active Roles console, with each object representing a certain type of custom workflow activity.

Design elements

The extensibility of workflow activity types is designed around two interactions: activity type deployment and activity type usage.

Activity type deployment

The deployment process involves the development of a script that implements the workflow action and declares the activity parameters; the creation of a Script Module containing that script; and the creation of a Policy Type object referring to that Script Module. To deploy an activity type to a different environment, you can export the activity type to an export file in the source environment and then import the file in the destination environment. The use of export files makes it easy to distribute custom activity types.

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating