Applies to: Exchange Server 2007
Topic Last Modified: 2008-04-16
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>]
|
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:
|
||
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:
|
||
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:
|
||
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.
|
||
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:
|
||
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:
|
||
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:
The results will be sorted in ascending order. |
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.
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.
Copy Code | |
---|---|
Get-Recipient -ResultSize unlimited Get-Recipient -RecipientType DynamicDistributionGroup -SortBy Name |