The Disable-MailContact cmdlet mail-disables existing mail contacts by removing the email attributes that are required by Exchange. Mail-disabled contacts are invisible to the *-MailContact cmdlets (with the exception of Enable-MailContact). All contacts (mail-enabled or not) are visible to the Get-Contact and Set-Contact cmdlets.

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.

The Identity parameter specifies the mail contact that you want to mail-disable. You can use any value that uniquely identifies the mail contact.

For example:

Name

Display name

Alias

Distinguished name (DN)

Canonical DN

Email address

GUID

This parameter accepts the following values:

Alias

Example: JPhillips

Canonical DN

Example: Atlanta.Corp.Contoso.Com/Users/JPhillips

Display Name

Example: Jeff Phillips

Distinguished Name (DN)

Example: CN=JPhillips,CN=Users,DC=Atlanta,DC=Corp,DC=contoso,DC=com

Domain\Account

Example: Atlanta\JPhillips

GUID

Example: fb456636-fe7d-4d58-9d15-5af57d0354c2

Immutable ID

Example: fb456636-fe7d-4d58-9d15-5af57d0354c2@contoso.com

Legacy Exchange DN

Example: /o=Contoso/ou=AdministrativeGroup/cn=Recipients/cn=JPhillips

SMTP Address

Example: Jeff.Phillips@contoso.com

User Principal Name

Example: JPhillips@contoso.com

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on if the cmdlet requires confirmation before proceeding.

Destructive cmdlets (for example, Remove-* cmdlets) have a built-in pause that forces you to acknowledge the command before proceeding. For these cmdlets, you can skip the confirmation prompt by using this exact syntax: -Confirm:$false.

Most other cmdlets (for example, New-* and Set-* cmdlets) don't have a built-in pause. For these cmdlets, specifying the Confirm switch without a value introduces a pause that forces you acknowledge the command before proceeding.

DomainController

Optional

Microsoft.Exchange.Data.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 (FQDN). For example, dc01.contoso.com.

IgnoreDefaultScope

Optional

System.Management.Automation.SwitchParameter

The IgnoreDefaultScope switch tells the command to ignore the default recipient scope setting for the Exchange Management Shell session, and to use the entire forest as the scope. This allows the command to access Active Directory objects that aren't currently available in the default scope.

Using the IgnoreDefaultScope switch introduces the following restrictions:

You can't use the DomainController parameter. The command uses an appropriate global catalog server automatically.

You can only use the DN for the Identity parameter. Other forms of identification, such as alias or GUID, aren't accepted.

WhatIf

Optional

System.Management.Automation.SwitchParameter

The WhatIf switch simulates the actions of the command. You can use this switch to view the changes that would occur without actually applying those changes. You don't need to specify a value with this switch.