Sdílet prostřednictvím


Get-Recipient (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-Recipient cmdlet to return a list of recipient objects from the Active Directory directory service.

Syntax

get-Recipient [-Identity <RecipientIdParameter>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientType <RecipientType[]>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

get-Recipient [-Credential <PSCredential>] [-DomainController <Fqdn>] [-Filter <String>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientType <RecipientType[]>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

get-Recipient [-Anr <String>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientType <RecipientType[]>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

Detailed Description

The Get-Recipient cmdlet retrieves attributes of the specified recipient. No parameters are required. If the cmdlet is run without a parameter, a complete list of recipients for the organization is returned.

To run the Get-Recipient 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 specifies a string on which to perform an ambiguous name resolution (ANR) search. You can specify a partial string and search for objects with an attribute that matches that string. The default attributes that are searched are:

  • CommonName (CN)

  • DisplayName (displayName)

  • FirstName (givenName)

  • LastName (sn)

  • Alias (mailNickname)

Credential

Optional

System.Management.Automation.PSCredential

The Credential parameter specifies the user name and password to use to access Active Directory.

If the Credential parameter is used, the command prompts for the account's password before continuing.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

To specify the fully qualified domain name (FQDN) of the domain controller that writes this configuration change to Active Directory, include the DomainController parameter in the command.

Filter

Optional

System.String

Use the Filter parameter to specify one or more attributes used to restrict the recipients that are returned by the query. This parameter cannot be used in conjunction with the Identity parameter or the Anr parameter.

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

Identity

Optional

Microsoft.Exchange.Configuration.Tasks.RecipientIdParameter

The Identity parameter identifies the recipient. You can use one of the following values:

  • GUID

  • Domain\Account

  • User principal name (UPN)

  • LegacyExchangeDN

  • Simple Mail Transfer Protocol (SMTP) address

  • Name

  • Alias

OrganizationalUnit

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

The OrganizationalUnit parameter specifies an organizational unit (OU) or domain canonical name, and is used to limit the results. If you use this parameter, you will only get recipients in the container that you specify. For example:

  • OU: westcoast.contoso.com/users

  • Domain: westcoast.contoso.com

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.

RecipientType

Optional

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

The RecipientType parameter is a filter to specify the type of recipient to include in the address list. You can use one or more of the following types:

  • UserMailbox

  • MailUser

  • MailContact

  • MailUniversalDistributionGroup

  • MailUniversalSecruityGroup

  • MailNonUniversalGroup

  • DynamicDistributionGroup

  • PublicFolder

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:

  • ConferenceRoomMailbox

  • EquipmentMailbox

  • LegacyMailbox

  • LinkedMailbox

  • UserMailbox

  • MailContact

  • DynamicDistributionGroup

  • MailForestContact

  • MailNonUniversalGroup

  • MailUniversalDistributionGroup

  • MailUniversalSecurityGroup

  • MailUser

  • PublicFolder

  • SharedMailbox

ResultSize

Optional

Microsoft.Exchange.Data.Unlimited

The ResultSize parameter specifies the maximum number of results to return. If you want to return all recipients that match the filter, use "unlimited" for the value of this parameter. The default value is 1000.

SortBy

Optional

System.String

The SortBy parameter specifies the attribute by which to sort the results. You can sort by only one attribute at a time. You can sort by the following attributes:

  • Alias

  • DisplayName

  • Name

The results will be sorted in ascending order.

Input Types

Return Types

Errors

Error Description

   

 

Exceptions

Exceptions Description

  

 

Example

The first example shows how to get information about all the recipients in your organization.

The second example shows how to get information about all the contacts in your organization, and sort them by name.

Get-Recipient -ResultSize unlimited
Get-Recipient -RecipientType DynamicDistributionGroup -SortBy Name