Remove-MailContact
Applies to: Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3
Use the Remove-MailContact cmdlet to delete an existing mail-enabled contact from the Active Directory directory service.
Syntax
Remove-MailContact -Identity <MailContactIdParameter> [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-IgnoreDefaultScope <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Detailed Description
The Remove-MailContact cmdlet removes an existing mail-enabled contact object from the Active Directory directory service.
To run Remove-MailContact cmdlet, the account you use must be delegated the following:
Exchange Recipient Administrator role
Account Operator role for the applicable Active Directory containers
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.MailContactIdParameter |
This parameter specifies the identity of the mail contact. |
DomainController |
Optional |
Microsoft.Exchange.Data.Fqdn |
To specify the fully qualified domain name of the domain controller that writes this configuration change to Active Directory, include the DomainController parameter. on the command. |
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. |
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:
|
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 don't have to specify a value with the WhatIf parameter. |
Input Types
Return Types
Errors
Error | Description |
---|---|
|
Exceptions
Exceptions | Description |
---|---|
|
Example
In this example, the Remove-MailContact command is used to remove the mail-enabled contact John Peoples from Active Directory.
Remove-MailContact -Identity contoso.com/john