Applies to: Exchange Server 2007
Topic Last Modified: 2007-06-05

Use the Get-MailUser cmdlet to retrieve the specified user's mail-related attributes from the Active Directory directory service.

Syntax

get-MailUser [-Identity <MailUserIdParameter>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-ResultSize <Unlimited>] [-SortBy <String>]
get-MailUser [-Credential <PSCredential>] [-DomainController <Fqdn>] [-Filter <String>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-ResultSize <Unlimited>] [-SortBy <String>]
get-MailUser [-Anr <String>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-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 that have an attribute that matches that string. The default attributes searched are:

  • CommonName (CN)

  • DisplayName (displayName)

  • FirstName (givenName)

  • LastName (sn)

  • Alias (mailNickname)

Credential

Optional

System.Management.Automation.PSCredential

The Credential parameter specifies the account to use to gain access to 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

The Filter parameter is used to filter the list of recipients returned. You can specify the attributes to filter.

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

Identity

Optional

Microsoft.Exchange.Configuration.Tasks.MailUserIdParameter

The Identity parameter identifies the user. You can include the user's ADObjectID, distinguished name (DN), LegacyExchangeDN, GUID, Domain\SamAccountName, user principal name (UPN), e-mail address, or alias.

OrganizationalUnit

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

The OrganizationalUnit parameter specifies a container in which to limit the results. You can specify either an organizational unit (OU) or a domain. The canonical name should be specified. 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.

ResultSize

Optional

Microsoft.Exchange.Data.Unlimited

The ResultSize parameter specifies the maximum number of recipient objects to return. If not specified, the parameter returns all results that match the filter.

SortBy

Optional

System.String

The SortBy parameter specifies the attribute by which to sort the results. Sorting is performed one attribute at a time and is always performed in ascending order.

Detailed Description

Important:
In Microsoft Exchange Server 2007, mail-enabled user settings are retrieved with the Exchange Management Shell only.

The Get-MailUser cmdlet retrieves all mail-related attributes of the specified user.

To run the Get-MailUser 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.

Note:
Not all user attributes are retrieved by the Get-MailUser cmdlet. You can get additional user attributes with the Get-User cmdlet.

Input Types

Return Types

Errors

Error Description

 

Exceptions

Exceptions Description

 

Example

In the first example, the Get-MailUser command is used without parameters to retrieve a complete list of mail-enabled users for the entire Exchange organization.

In the second example, the mail settings for the user Ted are retrieved and then piped to the Format-List cmdlet for display.

Copy Code
Get-MailUser
Get-MailUser -Identity Ted | Format-List