Applies to: Exchange Server 2007
Topic Last Modified: 2007-06-05

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

Syntax

connect-Mailbox -Identity <StoreMailboxIdParameter> -Database <DatabaseIdParameter> [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>] [-Alias <String>] [-DomainController <Fqdn>] [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>] [-ManagedFolderMailboxPolicyAllowed <SwitchParameter>] [-User <UserIdParameter>]
connect-Mailbox -Identity <StoreMailboxIdParameter> -Database <DatabaseIdParameter> -ValidateOnly <SwitchParameter> [-DomainController <Fqdn>]
connect-Mailbox -Identity <StoreMailboxIdParameter> -Database <DatabaseIdParameter> -Shared <SwitchParameter> [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>] [-Alias <String>] [-DomainController <Fqdn>] [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>] [-ManagedFolderMailboxPolicyAllowed <SwitchParameter>] [-User <UserIdParameter>]
connect-Mailbox -Identity <StoreMailboxIdParameter> -Database <DatabaseIdParameter> -Equipment <SwitchParameter> [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>] [-Alias <String>] [-DomainController <Fqdn>] [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>] [-ManagedFolderMailboxPolicyAllowed <SwitchParameter>] [-User <UserIdParameter>]
connect-Mailbox -Identity <StoreMailboxIdParameter> -Database <DatabaseIdParameter> -LinkedDomainController <Fqdn> -LinkedMasterAccount <UserIdParameter> [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>] [-Alias <String>] [-DomainController <Fqdn>] [-LinkedCredential <PSCredential>] [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>] [-ManagedFolderMailboxPolicyAllowed <SwitchParameter>] [-User <UserIdParameter>]
connect-Mailbox -Identity <StoreMailboxIdParameter> -Database <DatabaseIdParameter> -Room <SwitchParameter> [-ActiveSyncMailboxPolicy <MailboxPolicyIdParameter>] [-Alias <String>] [-DomainController <Fqdn>] [-ManagedFolderMailboxPolicy <MailboxPolicyIdParameter>] [-ManagedFolderMailboxPolicyAllowed <SwitchParameter>] [-User <UserIdParameter>]
connect-Mailbox -Identity <StoreMailboxIdParameter> -Database <DatabaseIdParameter> [-DomainController <Fqdn>]

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

  • Server name\database name

  • Server name\storage group\database name

If you do not specify the server name, the cmdlet will search for the database on the local server. If you have multiple databases with the same name on the same server, you must specify the storage group.

Equipment

Required

System.Management.Automation.SwitchParameter

The Equipment parameter specifies that the type of resource is equipment, if this mailbox is a resource mailbox. This parameter is required only if you are 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 does not 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 are 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 will grant 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 are connecting a linked mailbox.

Room

Required

System.Management.Automation.SwitchParameter

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

Shared

Required

System.Management.Automation.SwitchParameter

The Shared parameter specifies that you are creating a shared mailbox. A shared mailbox is a mailbox to which multiple users can log on. This mailbox is not associated with any of the users that can log on. It is associated with a disabled user account.

This parameter is required only if you are connecting a shared mailbox.

ValidateOnly

Required

System.Management.Automation.SwitchParameter

The ValidateOnly parameter instructs the command to simulate the actions that it would take on the object. If you do not use the User parameter, you can use this ValidateOnly parameter to view the user account to which the command will connect the mailbox. If it cannot find a unique match for the mailbox, it will not display any users.

ActiveSyncMailboxPolicy

Optional

Microsoft.Exchange.Configuration.Tasks.MailboxPolicyIdParameter

The ActiveSyncMailboxPolicy parameter specifies the ActiveSync mailbox policy to enable for the mailbox after it is connected.

Alias

Optional

System.String

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

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

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

The DomainController parameter specifies the domain controller to use to write this configuration change to Active Directory. Use the fully qualified domain name (FQDN) of the domain controller that you want to use.

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 are enabling a linked mailbox.

ManagedFolderMailboxPolicy

Optional

Microsoft.Exchange.Configuration.Tasks.MailboxPolicyIdParameter

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

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 do not specify this parameter, the command will use the LegacyExchangeDN and DisplayName attributes of the Exchange mailbox object to find a user account that matches the mailbox object. If it cannot find a unique match, it will not connect the mailbox.

ManagedFolderMailboxPolicyAllowed

Optional

System.Management.Automation.SwitchParameter

The ManagedFolderMailboxPolicyAllowed parameter bypasses the warning that messaging records management features are not supported for e-mail clients using versions of Outlook earlier than Outlook 2007. When a managed folder mailbox policy is assigned to a mailbox using the ManagedFolderMailboxPolicy parameter, the warning appears by default unless ManagedFolderMailboxPolicyAllowed is used.

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

Detailed Description

To run the Connect-Mailbox cmdlet, the account you use must be delegated the following:

  • Exchange Recipient Administrator role

For more information about permissions, delegating roles, and the rights that are required to administer Microsoft Exchange Server 2007, see Permission Considerations.

Important:
If you link a mailbox to an existing Active Directory user object, that Active Directory user object will have 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 do not use the User parameter, we recommend that you use the ValidateOnly parameter to verify which user account the mailbox will be connected to.

Input Types

Return Types

Errors

Error Description

 

Exceptions

Exceptions Description

 

Example

The following example shows how to connect John Peoples' (john@contoso.com) disconnected mailbox. It does not 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 Peoples"