After creating a remote mailbox, you can manage it through the Active Roles Console and the Web Interface. Console supports the following administration actions:
-
Exchange General
-
View or change the alias
-
View or change the option to use MAPI rich text format
-
Hide the user or contact from Exchange address lists
-
View or change custom attributes
-
Exchange Advanced
-
View or change the simple display name
-
Downgrade high priority mail bound for X.400.
-
View or change the Internet Locator Service (ILS) settings
-
Email Address
-
View, add, edit or remove email addresses
-
View or change the default reply address for each address type
-
View or change the external email address
-
Set the option to update email addresses based on email address policy
-
Mail flow Settings
For more information on Exchange Online properties, see Viewing or modifying the Exchange Online properties of a remote mailbox in the Active Roles Web Interface User Guide.
To import Azure or M365 Windows PowerShell modules, and run their corresponding M365 services within existing Active Roles workflows, configure M365 automation workflows. These workflows support running scripts from the following Windows PowerShell modules:
Creating a new M365 automation workflow has the following steps:
-
In the Configuration > Script Modules node of the Active Roles Console (also known as the MMC Interface), create the new M365 script that you want to run with the new M365 automation workflow.
-
In the New Workflow wizard, configure the new M365 automation workflow.
-
With the O365 script execution configuration activity of the Workflow Designer, specify the Azure tenant to which the configured workflow will apply.
-
Import the new M365 script into the workflow created in the first step.
NOTE: By default, Active Roles does not select any Azure tenants automatically after you configured a new workflow with the New Workflow wizard. After the workflow is created, configure one in the Workflow Editor, otherwise the workflow will fail with the following error message:
Select a configured Azure tenant from the Select a Tenant to configure O365 Services drop-down list. Alternatively, under Parameter values, provide a valid Tenant ID, Tenant Name, Application (Client) ID and Application (Client) Certificate Thumbprint to override Azure tenant details from the workflow.
For more information on how to configure an M365 automation workflow, see Creating a Microsoft 365 automation workflow. For a list of sample M365 workflow scripts, see Sample Office 365 workflow scripts.
To import Azure or Microsoft 365 Windows PowerShell modules, and run their scripts within existing Active Roles workflows, configure a Microsoft 365 (M365) automation workflow.
Prerequisites
Before starting the configuration of an M365 automation workflow, make sure that the following conditions are met:
-
The following Windows PowerShell modules are installed on the system running Active Roles:
If these PowerShell modules are not installed, Active Roles cannot run workflows that include M365 PowerShell script execution activities.
NOTE: Consider the following when planning to use the Exchange Online Management module:
-
To run a Sample Azure Hybrid Migration script, an on-premises Microsoft Exchange deployment must be available.
-
As Exchange Online is connected to Exchange Online PowerShell, make sure that the https://outlook.office365.com/powershell-liveid/ URL is not blocked in your organization domain, and that network connectivity is available.
-
You already created the M365 script module to use as a script activity with the M365 automation workflow. For more information, see Script activity.
To create a Microsoft 365 automation workflow
- In the Active Roles Console (also known as the MMC Interface), expand Configuration > Policies.
- To launch the New Workflow wizard, right-click Workflow, and select New > Workflow in the context menu.
- On the Name and Description page, enter a Name and optionally, a Description for the new workflow.
- On the Workflow Type page, under This workflow is intended to start, select On user demand or on a scheduled basis (automation workflow).
- On the Completion page, click Finish.
- To configure the Azure tenant connection settings of the new M365 automation workflow, double-click the workflow to open the Workflow Designer, then click Basic Activities > O365 script execution configuration.
-
Specify the Azure tenant with one of the available methods:
-
Under Select a Tenant to configure O365 Services, select the Azure tenant you want to use with the automation workflow. This setting lists all Azure tenants that are configured in the Active Roles Configuration Center, as described in Configuring a new Azure tenant and consenting Active Roles as an Azure application.
-
Alternatively, to provide the Azure tenant connection details manually, click the parameters under Parameter values, and specify the Tenant ID, Tenant Name, Application (Client) ID, and Application (Client) Certificate Thumbprint of the Azure tenant as they appear on the Azure portal.
NOTE: Providing the Azure tenant details manually overrides the selection of the Select a Tenant to configure O365 Services drop-down list.
To apply your changes, click OK.
-
To specify the M365 script to use in the workflow, click Basic Activities > Script.
-
In the Script Activity window, in the General tab, specify the Name (and optionally, the Description) of the M365 script.
-
To select the M365 script to use in the automation workflow, click Script to use > Browse, then select your M365 script in the Script Modules tree.
-
To apply your changes, click OK.
NOTE: The configured workflow will run successfully only if the specified script is well-formed and complete.
This section contains Microsoft 365 (M365) workflow script samples for reference.
$context.O365ImportModules(@(array-of-modules))
The O365ImportModules function lets you load an array of Azure and M365 Windows PowerShell modules. The function supports loading the following modules:
Once the modules are loaded, the function creates a connection to the specified modules with the connection details specified in the O365 script execution configuration workflow activity. For more information, see Creating a Microsoft 365 automation workflow.
Example: Importing all supported Azure and M365 Windows PowerShell modules
In this example, the O365ImportModules function is used to import all Windows PowerShell modules that M365 automation workflows support. After that, one command is invoked for each imported PowerShell module, respectively.
function Microsoft365ScriptTest() {
$context.O365ImportModules(@("Az.Accounts", "Az.Resources", "ExchangeOnlineManagement", "Microsoft.Graph"))
$context.O365ExecuteScriptCmd("Get-Module | Select-Object -Property ModuleType,Version,Name | Out-File -FilePath C:\WS\Files\ImportedModulesInnerRunspace.txt")
Get-AzContext | ConvertTo-Json | Out-File -FilePath C:\WS\Files\Az.txt
Get-EXOMailbox -Identity user | ConvertTo-Json | Out-File -FilePath C:\WS\Files\ExchangeOnlineManagement.txt
Get-MgUser -UserId "e38349d9-978a-4e4c-809b-189b68fe713a" | ConvertTo-Json | Out-File -FilePath C:\WS\Files\Microsoft.Graph.txt
Get-Module | Select-Object -Property ModuleType,Version,Name | Out-File -FilePath C:\WS\Files\ImportedModulesOuterRunspace.txt
}
$context.O365ImportModule (module)
The O365ImportModule function lets you load a single M365 or Azure Windows PowerShell module. If you have multiple versions of the specified module installed, you can also specify the module version to load.
NOTE: The O365ImportModule function supports specifying major module versions only (such as version 2.x).
Example: Importing the Azure Az PowerShell module
In this example, the O365ImportModule function is used to import version 2.x of the Microsoft Azure Az Windows PowerShell module.
function TestImportTeamsModule() {
$context.O365ImportModule("AzureAz", 2)
}
$context.O365ExecuteScriptCmd(string-or-cmd )
The O365ExecuteScriptCmd function passes any string or command specified in the script, then runs and returns the results as a PSObject.
$context.O365RemoveAllModulesSessions()
The O365RemoveAllModulesSessions script disconnects all PSSessions and removes all modules from the PowerShell pool, allowing Active Roles to import new modules again.
Example: Removing all Windows PowerShell module sessions
In this example, the O365RemoveAllModulesSessions function is used to disconnect the PSSession related to a previously loaded Azure Az module, and then remove the Azure Az module from the PowerShell pool.
#Get a list of disabled users and Directory Roles available
$_usersinroles= @()
$_default_log = "C:\temp\Roles.csv"
$context.O365ImportModule("Microsoft.Graph", 1)
$context.O365ExecuteScriptCmd("Get-MgUser -filter 'accountEnabled eq false'" +" | Export-Csv " +"c:\temp\DisabledUsers.csv" +" -NoTypeInformation")
$context.O365ExecuteScriptCmd("Get-MgDirectoryRole | Export-csv "+$_default_log )
$context.O365RemoveAllModulesSessions()