Commands › Exchange Online

Connect-Mailbox

Exchange Online ExchangeOnlineManagement Connect-*

Connect disconnected mailboxes to existing user accounts that don't already have mailboxes.

Quick start script

# Connect-Mailbox — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Connect-Mailbox -Identity <StoreMailboxIdParameter> -Database <DatabaseIdParameter> -Equipment <SwitchParameter> | Format-List

# 3. Export for evidence / drift tracking
Connect-Mailbox | Export-Clixml .\Mailbox-$(Get-Date -Format yyyyMMdd).xml

Syntax — 6 parameter sets

Equipment

Connect-Mailbox [-Identity] <StoreMailboxIdParameter> [-Database] <DatabaseIdParameter> [-Equipment]
 [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>]
 [-Alias <String>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Force]
 [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>]
 [-ManagedFolderMailboxPolicyAllowed]
 [-RetentionPolicy <MailboxPolicyIdParameter>]
 [-User <UserIdParameter>]
 [-WhatIf]
 [<CommonParameters>]

Linked

Connect-Mailbox [-Identity] <StoreMailboxIdParameter> [-Database] <DatabaseIdParameter> -LinkedDomainController <Fqdn> -LinkedMasterAccount <UserIdParameter> [-LinkedCredential <PSCredential>]
 [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>]
 [-Alias <String>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Force]
 [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>]
 [-ManagedFolderMailboxPolicyAllowed]
 [-RetentionPolicy <MailboxPolicyIdParameter>]
 [-User <UserIdParameter>]
 [-WhatIf]
 [<CommonParameters>]

Room

Connect-Mailbox [-Identity] <StoreMailboxIdParameter> [-Database] <DatabaseIdParameter> [-Room]
 [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>]
 [-Alias <String>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Force]
 [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>]
 [-ManagedFolderMailboxPolicyAllowed]
 [-RetentionPolicy <MailboxPolicyIdParameter>]
 [-User <UserIdParameter>]
 [-WhatIf]
 [<CommonParameters>]

Shared

Connect-Mailbox [-Identity] <StoreMailboxIdParameter> [-Database] <DatabaseIdParameter> [-Shared]
 [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>]
 [-Alias <String>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-Force]
 [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>]
 [-ManagedFolderMailboxPolicyAllowed]
 [-RetentionPolicy <MailboxPolicyIdParameter>]
 [-User <UserIdParameter>]
 [-WhatIf]
 [<CommonParameters>]

2 more parameter sets — see the parameter table below.

Parameters (22)

ParameterTypeRequiredWhat it controls
-Identity StoreMailboxIdParameter yes The Identity parameter specifies the mailbox that you want to connect to a user account. This parameter doesn't specify an Active Directory object. You can use the following values to identify the mailbox:
-Database DatabaseIdParameter yes The Database parameter specifies the Exchange database that contains the mailbox that you want to connect. You can use any value that uniquely identifies the database. For example:
-Equipment SwitchParameter yes The Equipment switch is required to connect equipment mailboxes. You don't need to specify a value with this switch.
-LinkedDomainController Fqdn yes The LinkedDomainController parameter specifies the domain controller in the forest where the user account resides, if the mailbox is a linked mailbox. The domain controller in the forest where the user account...
-LinkedMasterAccount UserIdParameter yes The LinkedMasterAccount parameter specifies the master account in the forest where the user account resides, if this mailbox is a linked mailbox. The master account is the account that the mailbox is linked to. The...
-Room SwitchParameter yes The Room switch is required to connect room mailboxes. You don't need to specify a value with this switch.
-Shared SwitchParameter yes The Shared switch is required to connect shared mailboxes. You don't need to specify a value with this switch.
-ValidateOnly SwitchParameter yes The ValidateOnly switch specifies whether to evaluate the potential success or failure of the command without making changes. You don't need to specify a value with this switch.
-ActiveSyncMailboxPolicy MailboxPolicyIdParameter The ActiveSyncMailboxPolicy parameter specifies the mobile device mailbox policy that's applied to the mailbox. You can use any value that uniquely identifies the policy. For example:.
-AddressBookPolicy AddressBookMailboxPolicyIdParameter The AddressBookPolicy parameter specifies the address book policy that's applied to the mailbox. You can use any value that uniquely identifies the address book policy. For example:
-Alias String The Alias parameter specifies the Exchange alias (also known as the mail nickname) for the recipient. This value identifies the recipient as a mail-enabled object, and shouldn't be confused with multiple email...
-AllowLegacyDNMismatch SwitchParameter This parameter is reserved for internal Microsoft use.
-Archive SwitchParameter The Archive switch specifies whether to connect the associated archive mailbox. You don't need to specify a value with this switch.
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-DomainController Fqdn The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name...
-Force SwitchParameter The Force switch hides warning or confirmation messages. You don't need to specify a value with this switch.
-LinkedCredential PSCredential The LinkedCredential parameter specifies the credentials used to access the domain controller that's specified by the LinkedDomainController parameter. This parameter is optional, even if you're connecting a linked mailbox.
-ManagedFolderMailboxPolicy MailboxPolicyIdParameter This parameter is reserved for internal Microsoft use.
-ManagedFolderMailboxPolicyAllowed SwitchParameter This parameter is reserved for internal Microsoft use.
-RetentionPolicy MailboxPolicyIdParameter The RetentionPolicy parameter specifies the retention policy that's applied to the mailbox. You can use any value that uniquely identifies the policy. For example:
-User UserIdParameter The User parameter specifies the user object in Active Directory that you want to connect the mailbox to.
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.