# Add Shared Mailbox

### Description

This script creates a shared mailbox in Exchange Online and configures various settings such as delegation, auto-mapping, and message copy options. Also if specified, it disables the associated EntraID user account.

### Location

Organization → Mail → Add Shared Mailbox

**Full Runbook name**

rjgit-org\_mail\_add-shared-mailbox

### Permissions

#### Application permissions

* **Type**: Office 365 Exchange Online
  * Exchange.ManageAsApp

#### RBAC roles

* Exchange administrator

### Parameters

#### MailboxName

The alias (mailbox name) for the shared mailbox.

| Property      | Value  |
| ------------- | ------ |
| Required      | true   |
| Default Value |        |
| Type          | String |

#### DisplayName

Display name for the shared mailbox.

| Property      | Value  |
| ------------- | ------ |
| Required      | false  |
| Default Value |        |
| Type          | String |

#### DomainName

Optional domain used for the primary SMTP address; if not provided, the default domain is used.

| Property      | Value  |
| ------------- | ------ |
| Required      | false  |
| Default Value |        |
| Type          | String |

#### Language

The language/locale for the shared mailbox. This setting affects folder names like "Inbox". Default is "en-US".

| Property      | Value  |
| ------------- | ------ |
| Required      | false  |
| Default Value | en-US  |
| Type          | String |

#### DelegateTo

Optional user who receives delegated access to the mailbox.

| Property      | Value  |
| ------------- | ------ |
| Required      | false  |
| Default Value |        |
| Type          | String |

#### AutoMapping

If set to true, the mailbox is automatically mapped in Outlook for the delegate.

| Property      | Value   |
| ------------- | ------- |
| Required      | false   |
| Default Value | False   |
| Type          | Boolean |

#### MessageCopyForSentAsEnabled

If set to true, copies of messages sent as the mailbox are stored in the mailbox sent items.

| Property      | Value   |
| ------------- | ------- |
| Required      | false   |
| Default Value | True    |
| Type          | Boolean |

#### MessageCopyForSendOnBehalfEnabled

If set to true, copies of messages sent on behalf of the mailbox are stored in the mailbox sent items.

| Property      | Value   |
| ------------- | ------- |
| Required      | false   |
| Default Value | True    |
| Type          | Boolean |

#### DisableUser

If set to true, the associated Entra ID user account is disabled.

| Property      | Value   |
| ------------- | ------- |
| Required      | false   |
| Default Value | True    |
| Type          | Boolean |

[Back to Runbook Reference overview](/automation/runbooks/runbook-references.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.realmjoin.com/automation/runbooks/runbook-references/org/mail/add-shared-mailbox.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
