Get-Contact (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 Get-Contact cmdlet to retrieve information on a specified contact or contacts.

Syntax

Get-Contact [-Identity <ContactIdParameter>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

Get-Contact [-Credential <PSCredential>] [-DomainController <Fqdn>] [-Filter <String>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

Get-Contact [-Anr <String>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

Detailed Description

The Get-Contact cmdlet queries the properties of a specific contact or contact recipient objects in the Active Directory directory service.

To run the Get-Contact cmdlet, the account you use must be delegated the following:

  • Exchange View-Only 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

Anr

Optional

System.String

The Anr parameter is used to search for objects that match a partial string that is provided. It is similar to a search using wildcard characters.

Credential

Optional

System.Management.Automation.PSCredential

The Credential parameter specifies the account used to query Active Directory for the contact's credentials.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

To specify the fully qualified domain name (FQDN) of the domain controller that retrieves data from Active Directory, include the DomainController parameter in the command.

Filter

Optional

System.String

The Filter parameter specifies a set of attributes that is used to restrict the recipients that are returned by the query.

For more information about the filterable properties, see Filterable Properties for the -Filter Parameter in Exchange 2007 RTM.

Identity

Optional

Microsoft.Exchange.Configuration.Tasks.ContactIdParameter

The Identity parameter takes one of the following values:

  • GUID

  • Distinguished name (DN)

  • Domain\Account

  • User principal name (UPN)

  • LegacyExchangeDN

  • Simple Mail Transfer Protocol (SMTP) address

  • Alias

OrganizationalUnit

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

The OrganizationalUnit parameter returns objects only from the specified organizational unit (OU).

ReadFromDomainController

Optional

System.Management.Automation.SwitchParameter

The ReadFromDomainController parameter specifies that the user information is read from a domain controller in the user's domain. If you set the recipient scope to include all recipients in the forest, and if you do not use this parameter, it is possible that the user information is read from a global catalog with outdated information. If you use this parameter, multiple reads might be necessary to get the information.

Note

By default, the recipient scope is set to the domain that hosts your Exchange servers.

RecipientTypeDetails

Optional

Microsoft.Exchange.Data.Directory.Recipient.RecipientTypeDetails[]

The RecipientTypeDetails parameter specifies the type of recipients that are returned. Recipient types in Microsoft Exchange Server 2007 are divided into recipient types and subtypes. Each recipient type contains all common properties for all subtypes. For example, the type UserMailbox represents a user account in Active Directory with an associated mailbox. Because there are several mailbox types, each mailbox type is identified by the RecipientTypeDetails parameter. For example, a conference room mailbox has RecipientTypeDetails set to ConferenceRoomMailbox, whereas a user mailbox has RecipientTypeDetails set to UserMailbox.

For this command, the available recipient type details are:

  • Contact

  • MailEnabledContact

  • MailEnabledForestContact

ResultSize

Optional

Microsoft.Exchange.Data.Unlimited

The ResultSize parameter specifies the maximum number of results to return.

SortBy

Optional

System.String

The SortBy parameter specifies to sort by a single attribute in ascending order.

Input Types

Return Types

Errors

Error Description

 

 

Exceptions

Exceptions Description

 

Example

In this example, the Get-Contact command retrieves the contact Ted Bremer and pipelines the object to the Format-List command to display the information about the contact.

Get-Contact -Identity TedBremer | Format-List