Share via


Disable-Mailbox

 

Applies to: Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3

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> [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-IgnoreDefaultScope <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

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.

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 Microsoft 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:

  • GUID

  • Distinguished name

  • Domain\Account

  • User principal name

  • LegacyExchangeDN

  • SmtpAddress

  • Alias

Confirm

Optional

System.Management.Automation.SwitchParameter

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

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.

IgnoreDefaultScope

Optional

System.Management.Automation.SwitchParameter

The IgnoreDefaultScope parameter instructs the command to ignore the default recipient scope setting for the Exchange Management Shell and use the entire forest as the scope. This allows the command to access Active Directory objects that are not currently in the default scope. Using the IgnoreDefaultScope parameter introduces the following restrictions:

  • You cannot use the DomainController parameter. The command will use an appropriate global catalog server automatically.

  • You can only use the distinguished name for the Identity parameter. Other forms of identification, such as alias or GUID, are not accepted.

WhatIf

Optional

System.Management.Automation.SwitchParameter

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

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