Applies to: Exchange Server 2013

Topic Last Modified: 2012-08-08

Use the Connect-Mailbox cmdlet to connect a disconnected mailbox to an Active Directory user object.

For information about the parameter sets in the Syntax section below, see Syntax.

Syntax

Connect-Mailbox [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>] [-AddressBookPolicy <AddressBookMailboxPolicyIdParameter>] [-Alias <String>] [-Archive <SwitchParameter>] [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>] [-ManagedFolderMailboxPolicyAllowed <SwitchParameter>] [-RetentionPolicy <MailboxPolicyIdParameter>] [-User <UserIdParameter>] <COMMON PARAMETERS>
Connect-Mailbox -ValidateOnly <SwitchParameter> <COMMON PARAMETERS>
Connect-Mailbox -Shared <SwitchParameter> [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>] [-Alias <String>] [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>] [-ManagedFolderMailboxPolicyAllowed <SwitchParameter>] [-RetentionPolicy <MailboxPolicyIdParameter>] [-User <UserIdParameter>] <COMMON PARAMETERS>
Connect-Mailbox -Room <SwitchParameter> [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>] [-Alias <String>] [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>] [-ManagedFolderMailboxPolicyAllowed <SwitchParameter>] [-RetentionPolicy <MailboxPolicyIdParameter>] [-User <UserIdParameter>] <COMMON PARAMETERS>
Connect-Mailbox -LinkedDomainController <Fqdn> -LinkedMasterAccount <UserIdParameter> [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>] [-Alias <String>] [-LinkedCredential <PSCredential>] [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>] [-ManagedFolderMailboxPolicyAllowed <SwitchParameter>] [-RetentionPolicy <MailboxPolicyIdParameter>] [-User <UserIdParameter>] <COMMON PARAMETERS>
Connect-Mailbox -Equipment <SwitchParameter> [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>] [-Alias <String>] [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>] [-ManagedFolderMailboxPolicyAllowed <SwitchParameter>] [-RetentionPolicy <MailboxPolicyIdParameter>] [-User <UserIdParameter>] <COMMON PARAMETERS>
COMMON PARAMETERS: -Database <DatabaseIdParameter> -Identity <StoreMailboxIdParameter> [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Examples

EXAMPLE 1

This example connects John Evans' (john@contoso.com) disconnected mailbox. The example doesn't specify a user object to connect the mailbox to, so the command attempts to find a uniquely matched user object to connect the mailbox to.

Copy Code
Connect-Mailbox -Database "Mailbox Database" -Identity "John Evans"

EXAMPLE 2

This example connects a linked mailbox.

Copy Code
Connect-Mailbox -Identity "John Evans" -Database "MBXDB02" -LinkedDomainController FabrikamDC01 -LinkedMasterAccount john@fabrikam.com

EXAMPLE 3

This example connects an equipment mailbox.

Copy Code
Connect-Mailbox -Identity "CAR001" -Database "MBXResourceDB" -Equipment -User "CAR001"

EXAMPLE 4

This example connects a room mailbox.

Copy Code
Connect-Mailbox -Identity "ConfRm212" -Database "MBXResourceDB" -Room -User "Conference Room 212"

Detailed Description

If you link a mailbox to an existing Active Directory user object, that Active Directory user object has full access to the mailbox and all mail in the mailbox. If you use the User parameter to specify the Active Directory user account, make sure you specify the correct account. If you don't use the User parameter, we recommend that you use the ValidateOnly parameter to verify which user account the mailbox is connected to.

You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "Recipient Provisioning Permissions" section in the Recipients Permissions topic.

Parameters

Parameter Required Type Description

Database

Required

Microsoft.Exchange.Configuration.Tasks.DatabaseIdParameter

The Database parameter specifies the Exchange database that contains the mailbox that you want to connect. You can use the following values:

  • GUID of the database

  • Database name

Equipment

Required

System.Management.Automation.SwitchParameter

The Equipment switch specifies that the type of resource is equipment, if this mailbox is a resource mailbox. This switch is required only if you're connecting a resource mailbox.

Identity

Required

Microsoft.Exchange.Configuration.Tasks.StoreMailboxIdParameter

The Identity parameter specifies the mailbox object in the Exchange database to connect to an Active Directory user object. This parameter doesn't specify an Active Directory object. You can use the following values:

  • GUID of the mailbox

  • Display name

  • LegacyExchangeDN

LinkedDomainController

Required

Microsoft.Exchange.Data.Fqdn

The LinkedDomainController parameter specifies the domain controller in the forest where the user account resides, if this mailbox is a linked mailbox. The domain controller in the forest where the user account resides is used to get security information for the account specified by the LinkedMasterAccount parameter.

This parameter is required only if you're connecting a linked mailbox.

LinkedMasterAccount

Required

Microsoft.Exchange.Configuration.Tasks.UserIdParameter

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 to which the mailbox links. The master account grants access to the mailbox. You can use one of the following values:

  • GUID

  • Distinguished name (DN)

  • Domain\Account

  • User principal name (UPN)

  • LegacyExchangeDN

  • SmtpAddress

  • Alias

This parameter is required only if you're connecting a linked mailbox.

Room

Required

System.Management.Automation.SwitchParameter

The Room switch specifies that the type of resource is a room, if this mailbox is a resource mailbox. This switch is required only if you're connecting a resource mailbox.

Shared

Required

System.Management.Automation.SwitchParameter

The Shared switch specifies that you're creating a shared mailbox. A shared mailbox is a mailbox to which multiple users can log on. This mailbox isn't associated with any of the users that can log on. It's associated with a disabled user account.

This switch is required only if you're connecting a shared mailbox.

ValidateOnly

Required

System.Management.Automation.SwitchParameter

The ValidateOnly switch tells the cmdlet to evaluate the conditions and requirements necessary to perform the operation and then reports whether the operation will succeed or fail. No changes are made when the ValidateOnly switch is used.

ActiveSyncMailboxPolicy

Optional

Microsoft.Exchange.Configuration.Tasks.MailboxPolicyIdParameter

The ActiveSyncMailboxPolicy parameter specifies the Microsoft ActiveSync mailbox policy to enable for the mailbox after it's connected.

AddressBookPolicy

Optional

Microsoft.Exchange.Configuration.Tasks.AddressBookMailboxPolicyIdParameter

The AddressBookPolicy parameter specifies the Address book policy to apply to this mailbox when it's connected.

Alias

Optional

System.String

The Alias parameter specifies the alias (mail nickname) for the mailbox after it's connected.

The alias can be a combination of characters separated by a period with no intervening spaces. Don't use special characters in the alias.

Archive

Optional

System.Management.Automation.SwitchParameter

The Archive switch specifies whether to connect the archive mailbox. You don't have to specify a value with this switch.

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm switch causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You don't have to specify a value with the Confirm switch.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

The DomainController parameter specifies the fully qualified domain name (FQDN) of the domain controller that writes this configuration change to Active Directory.

Force

Optional

System.Management.Automation.SwitchParameter

The Force switch specifies whether to suppress warning or confirmation messages. This switch can be used when the task is run programmatically and prompting for administrative input is inappropriate. If the Force switch isn't provided in the command, administrative input is prompted. If the Force switch is provided in the command, but the value is omitted, its default value is $true.

LinkedCredential

Optional

System.Management.Automation.PSCredential

The LinkedCredential parameter specifies credentials to use to access the domain controller specified by the LinkedDomainController parameter. This parameter is optional, even if you're enabling a linked mailbox.

ManagedFolderMailboxPolicy

Optional

Microsoft.Exchange.Configuration.Tasks.MailboxPolicyIdParameter

The ManagedFolderMailboxPolicy parameter specifies a managed folder policy object for the mailbox.

ManagedFolderMailboxPolicyAllowed

Optional

System.Management.Automation.SwitchParameter

The ManagedFolderMailboxPolicyAllowed switch bypasses the warning that messaging records management (MRM) features aren't supported for email clients using versions of Microsoft Outlook earlier than Office Outlook 2007. When a managed folder mailbox policy is assigned to a mailbox using the ManagedFolderMailboxPolicy parameter, the warning appears by default unless the ManagedFolderMailboxPolicyAllowed switch is used.

Note:
Outlook 2003 Service Pack 3 clients are supported but are provided limited functionality for MRM.

RetentionPolicy

Optional

Microsoft.Exchange.Configuration.Tasks.MailboxPolicyIdParameter

The RetentionPolicy parameter specifies the name of a retention policy that you want applied to this mailbox. Retention policies consist of tags that are applied to mailbox folders and mail items to determine the period of time that the items should be retained.

User

Optional

Microsoft.Exchange.Configuration.Tasks.UserIdParameter

The User parameter specifies the user object in Active Directory to which you want to connect the Exchange mailbox object. If you don't specify this parameter, the command uses the LegacyExchangeDN and DisplayName attributes of the Exchange mailbox object to find a user account that matches the mailbox object. If it can't find a unique match, it doesn't connect the mailbox.

WhatIf

Optional

System.Management.Automation.SwitchParameter

The WhatIf switch instructs the command to simulate the actions that it would take on the object. By using the WhatIf switch, you can view what changes would occur without having to apply any of those changes. You don't have to specify a value with the WhatIf switch.

Input Types

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn’t accept input data.

Return Types

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn’t return data.