Runbook: ACT-CreateRemoteMailbox.ps1
π Description
Creates a remote mailbox in an on-prem Active Directory environment and prepares the user for migration to Microsoft 365.
This runbook:
- Creates AD user (if needed)
- Creates a remote mailbox
- Stamps Exchange attributes
- Optionally assigns Microsoft 365 licenses
- Optionally sets mailbox features and policies
π§© Required Parameters
| Name | Description | Example |
|---|
DisplayName | Full display name | "John Doe" |
UPN | UserPrincipalName | "john.doe@contoso.com" |
πͺ Optional Parameters
| Name | Description | Example |
|---|
FirstName | First name | "John" |
LastName | Last name | "Doe" |
Alias | Mail alias | "jdoe" |
Department | Department | "HR" |
Title | Job title | "HR Specialist" |
ManagerUPN | Manager UPN | "manager@contoso.com" |
Office | Physical office | "Building A" |
EnableArchive | Enable archive mailbox | "true" |
AssignLicenses | Assign O365 licenses | "true" |
π€ Input Payload (Webhook JSON Example)
{
"customer": "Contoso",
"runbook": "ACT-CreateRemoteMailbox.ps1",
"issue_key": "{{issue.key}}",
"params": {
"DisplayName": "{{issue.fields.customfield_10200}}",
"UPN": "{{issue.fields.customfield_10201}}",
"FirstName": "{{issue.fields.customfield_10202}}",
"LastName": "{{issue.fields.customfield_10203}}",
"Department": "{{issue.fields.customfield_10204}}",
"Title": "{{issue.fields.customfield_10205}}",
"Office": "{{issue.fields.customfield_10206}}",
"ManagerUPN": "{{issue.fields.customfield_10207}}",
"EnableArchive": "true",
"AssignLicenses": "true"
}
}
π© Example Jira Automation Rule
When: Issue Created
Then: Send Web Request β POST β SymphonyDesk
{
"customer": "Contoso",
"runbook": "ACT-CreateRemoteMailbox.ps1",
"issue_key": "{{issue.key}}",
"params": {
"DisplayName": "{{triggerIssue.fields.customfield_10200}}",
"UPN": "{{triggerIssue.fields.customfield_10201}}",
"FirstName": "{{triggerIssue.fields.customfield_10202}}",
"LastName": "{{triggerIssue.fields.customfield_10203}}",
"Department": "{{triggerIssue.fields.customfield_10204}}",
"Title": "{{triggerIssue.fields.customfield_10205}}",
"EnableArchive": "true",
"AssignLicenses": "true"
}
}
π₯ Response (Success)
{
"job_id": "job-57fd921a",
"status": "success",
"output": "Remote mailbox created for john.doe@contoso.com"
}
π₯ Response (Error)
{
"job_id": "job-57fd921a",
"status": "error",
"message": "Unable to locate manager UPN",
"raw": "Get-ADUser : Cannot find user..."
}
π Requirements
- Must have Exchange on-prem with hybrid configuration
- Runner must have access to on-prem AD + Exchange
- Requires
ExchangeOnlineManagement module
- Requires hybrid cmdlet:
Enable-RemoteMailbox
- Requires
Get-SDConfig and Get-SDCredential working for the customer
- Customer secrets configured:
ExchangeCred
AzureAppRegistration (optional for licensing)
π Version History
| Version | Date | Changes |
|---|
| 1.0 | 2025-01-01 | Initial release of runbook |
| 1.1 | 2025-01-10 | Added license assignment support |
| 1.2 | 2025-01-12 | Added archive mailbox toggle |