Create Mailbox activity

  • Release version: Yokohama
  • Updated January 30, 2025
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Create Mailbox activity

    The Create Mailbox activity enables ServiceNow customers to automate the creation of new Active Directory users and corresponding Microsoft Exchange mailboxes for those users, provided they do not already exist. It utilizes the Microsoft ExchangeNew-Mailboxcommand and is accessible within the Workflow Editor under Custom Activities > Exchange > Mailbox.

    Show full answer Show less

    This activity replaces a previous Exchange activity available before the Geneva release. Existing workflows using the deprecated activity continue to function, but all new workflows must use this updated custom version. It leverages the PowerShell activity designer, allowing workflow administrators to manage input and output variables efficiently within the databus.

    Input Variables

    Key input parameters required to configure this activity include:

    • hostname: Exchange server hostname (IP addresses are not supported).
    • domain: Domain name assigned to the Exchange server; the MID Server must reside in this domain.
    • firstname, middleinitial, lastname: User's personal name details.
    • alias: Mailbox display name and email alias. Defaults to First name.Last name if unspecified and also serves as the user's principal name (UPN) if no UPN is provided.
    • password: Encrypted password for the new mailbox.
    • parameters: Optional JSON-formatted parameters for Exchange server commands. Must avoid duplicate or incorrectly formatted parameters. Switch parameters require a "parameter":"true" format.

    Output Variables

    The activity outputs the following variables to support workflow logic and troubleshooting:

    • result: Indicates success or failure of the mailbox creation.
    • error: Provides error messages if the operation fails.
    • output: Contains raw XML data returned from the Exchange server, including all mailbox attributes.

    Conditions

    • Success: Indicates the mailbox and Active Directory account were successfully created (or that the account existed and the mailbox was created).
    • Failure: Indicates the activity failed to create the mailbox or Active Directory account.

    Practical Benefits

    This activity streamlines user and mailbox provisioning by integrating directly with Exchange and Active Directory, reducing manual setup and potential errors. By using this within ServiceNow workflows, customers can automate onboarding processes, ensuring consistent and secure mailbox creation aligned with organizational policies.

    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.

    To access this activity in the Workflow Editor, select the Custom tab, and then navigate to Custom Activities > Exchange > Mailbox.
    Note:
    This activity replaces an Exchange activity by the same name available in releases prior to Geneva. If you have a workflow created in a previous version that uses the deprecated activity, your workflow will continue to work normally after upgrading to Geneva. However, all new workflows must use the custom version of this activity. This activity was built with the PowerShell activity designer, which gives workflow administrators the ability to store input and output variables in the databus.

    Input variables

    Table 1. Create Mailbox 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

    Table 2. Create Mailbox 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

    Table 3. Create Mailbox 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.