Create Mailbox activity
Summarize
Summary of Create Mailbox activity
The Create Mailbox activity allows ServiceNow customers to automate the creation of a new Active Directory user and a Microsoft Exchange mailbox for that user, if the user does not already exist. It leverages the Microsoft ExchangeNew-Mailboxcommand and is accessible in the Workflow Editor underCustom Activities > Exchange > Mailbox. This activity replaces the deprecated Exchange Create Mailbox activity from releases prior to Geneva, ensuring compatibility with newer ServiceNow versions.
Show less
Key Features
- Active Directory and Exchange integration: Automatically creates both AD user accounts and Exchange mailboxes.
- PowerShell activity designer: Enables workflow administrators to manage input and output variables in the databus for streamlined automation.
- Input variables: Includes hostname of the Exchange server (not IP), domain name (MID Server must be in the same domain), user details (first name, middle initial, last name), alias (used for mailbox address and UPN if not specified), password (encrypted), and optional JSON-formatted Exchange parameters.
- Parameter handling: Supports plain text conversion to SecureString where required; warns on duplicate or incorrectly formatted parameters; switch parameters require "parameter":"true" format.
- Output variables: Provide operation results including success/failure status, error messages if any, and the raw XML response from the Exchange server containing all Exchange attributes.
Key Outcomes
- Success condition: The mailbox and, if necessary, the Active Directory account are created successfully.
- Failure condition: The activity fails to create either the mailbox or the Active Directory account, with error details provided for troubleshooting.
Practical Considerations for ServiceNow Customers
This activity is essential for automating user onboarding workflows that require mailbox provisioning in Microsoft Exchange. It ensures consistent user account creation aligned with your domain policies and Exchange server configuration. Customers upgrading from pre-Geneva releases should transition to this custom activity for new workflows while legacy workflows remain operational.
The Create Mailbox activity creates a new Active Directory user, if that user does not already exist, and a Microsoft Exchange mailbox for that user.
This activity implements the Microsoft Exchange New-Mailbox command.
Input variables
| Variable | Description |
|---|---|
| hostname | The hostname of the Exchange server with which the activity interacts. Do not enter an IP address in this variable. |
| domain | The name of the Exchange server's assigned domain. Important: The
MID Server must be in the same domain as the Exchange server. |
| first_name | First name of the user. |
| middle_initial | Middle initial of the user. |
| last_name | Last name of the user. |
| alias | The display name for the mailbox address, the part of the email address to the left of the @ symbol. If no alias is specified, the activity uses First name.Last name as the alias. The alias is also used as the user's principal name (UPN) if none is specified in the optional parameters. |
| password | Password to use for the new mailbox. The password is encrypted when it is sent to the target host. |
| parameters | Optional parameters to pass to the Exchange server written in JavaScript Object
Notation (JSON). Exchange activities cannot pass parameters that reference an
object, such as a PSCredential object. Plain text is automatically converted to
SecureString objects for parameters that require that data type. Attempting to
save an activity that specifies duplicate parameters, including parameters from
activity variables, or incorrectly formatted JSON causes a warning message to
appear. Note: When passing a switch parameter, such as ForceUpgrade, you must use
the format "parameter":"true". |
Output variables
| Variable | Description |
|---|---|
| result | Either success or failure. |
| error | Error message if the operation fails. |
| output | Raw XML payload from the Exchange server. This data includes all Exchange attributes. |
Conditions
| Condition | Description |
|---|---|
| Success | The activity succeeded in creating a new mailbox for the specified user. If no Active Diectory account existed for that user, this activity succeeded in creating a new account. |
| Failure | The activity failed to create a new mailbox or an Active Directory account for the specified user. |