Get-DistributionGroup (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-DistributionGroup cmdlet to query for existing distribution groups.

Syntax

Get-DistributionGroup [-Identity <DistributionGroupIdParameter>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-ManagedBy <GeneralRecipientIdParameter>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-RecipientTypeDetails <RecipientTypeDetails[]>] [-ResultSize <Unlimited>] [-SortBy <String>]

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

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

Detailed Description

You can use distribution groups to create e-mail distribution lists and security groups to assign permissions to shared resources. Distribution groups can be used only with e-mail applications (such as Exchange) to send e-mail messages to collections of users. You can use the Get-DistributionGroup cmdlet to query for existing distribution groups.

To run the Get-DistributionGroup cmdlet, the account you use must be delegated one of the following:

  • Exchange View-Only Administrator role

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

ANR

Optional

System.String

The ANR parameter indicates that the argument will be resolved using ambiguous name resolution (ANR).

Credential

Optional

System.Management.Automation.PSCredential

The Credential parameter indicates the domain and user name of the account used to read the Active Directory directory service.

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 indicates the OPath filter used to filter recipients.

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

Identity

Optional

Microsoft.Exchange.Configuration.Tasks.DistributionGroupIdParameter

The Identity parameter of the distribution group takes one of the following forms:

  • GUID

  • Distinguished name (DN)

  • LegacyExchangeDN

  • Domain\Account Name

  • Alias

ManagedBy

Optional

Microsoft.Exchange.Configuration.Tasks.GeneralRecipientIdParameter

The ManagedBy parameter indicates the distinguished name of the user or contact that manages the group.

OrganizationalUnit

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

The OrganizationalUnit parameter limits results to a specific organizational unit (OU) container.

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:

  • MailNonUniversalGroup

  • MailUniversalDistributionGroup

  • MailUniversalSecurityGroup

ResultSize

Optional

Microsoft.Exchange.Data.Unlimited

The ResultSize parameter indicates the maximum number of recipient objects that will be returned.

SortBy

Optional

System.String

The SortBy attribute is used to sort the results.

Input Types

Return Types

Errors

Error Description

  

Exceptions

Exceptions Description

  

Example

The following code is an example of the Get-DistributionGroup command. In this example, the Get-DistributionGroup command retrieves the group Distribution Group1 and pipelines the object to the Format-List command to display the information about the distribution group.

Get-DistributionGroup -Identity "Distribution Group1" | Format-List