Disable-Mailbox (RTM)
Microsoft Exchange Server 2007 will reach end of support on April 11, 2017. To stay supported, you will need to upgrade. For more information, see Resources to help you upgrade your Office 2007 servers and clients.
Applies to: Exchange Server 2007
Use the Disable-Mailbox cmdlet to disable the mailbox of an existing user or InetOrgPerson and remove that object's Exchange attributes from the Active Directory directory service. The user account associated with the mailbox will remain in Active Directory but will no longer be associated with a mailbox.
Syntax
disable-Mailbox -Identity <MailboxIdParameter> [-DomainController <Fqdn>]
Detailed Description
The Disable-Mailbox cmdlet removes the mailbox's Exchange attributes from Active Directory. The mailbox is not deleted, and can be reconnected to its user at a later date by using the Connect-Mailbox cmdlet.
The Disable-Mailbox cmdlet also performs the cleanup task on the individual mailbox, so the mailbox will be disconnected immediately after this task completes. You do not have to wait for nightly maintenance or run the Clean-MailboxDatabase cmdlet for the mailbox to be disconnected.
Under normal circumstances, a mailbox is marked as disconnected immediately after the Disable-Mailbox or Remove-Mailbox command completes. However, if the mailbox was disabled or removed while the Exchange Information Store service was stopped, or if it was disabled or removed by an external means other than Exchange management interfaces, the status of the mailbox object in the Exchange mailbox database will not be marked as disconnected. In this case, you can use the Clean-MailboxDatabase cmdlet to scan the Active Directory directory service for disconnected mailboxes that are not yet marked as disconnected in the Microsoft Exchange mailbox database and update the status of those mailboxes in the Exchange mailbox store. For more information about the Clean-MailboxDatabase cmdlet, see Clean-MailboxDatabase (RTM).
To run the Disable-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 Exchange Server 2007, see Permission Considerations.
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
Identity |
Required |
Microsoft.Exchange.Configuration.Tasks.MailboxIdParameter |
This parameter specifies the mailbox you want to disable. You can use one of the following values:
|
DomainController |
Optional |
Microsoft.Exchange.Data.Fqdn |
This 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. |
Input Types
Return Types
Errors
Error | Description |
---|---|
|
|
Example
The following example shows how to disable the mailbox of user John Peoples, whose alias is john, and remove all the mailbox attributes from Active Directory.
Disable-Mailbox john@contoso.com