Applies to: Exchange Server 2013

Topic Last Modified: 2012-06-29

Use the Get-RemoteMailbox cmdlet to retrieve the mail-related attributes of one or more users in the on-premises Active Directory associated with mailboxes in the cloud-based service.

For information about the parameter sets in the Syntax section below, see Syntax.

Syntax

Get-RemoteMailbox [-Anr <String>] <COMMON PARAMETERS>
Get-RemoteMailbox [-Identity <RemoteMailboxIdParameter>] <COMMON PARAMETERS>
COMMON PARAMETERS: [-Archive <SwitchParameter>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-Filter <String>] [-IgnoreDefaultScope <SwitchParameter>] [-OnPremisesOrganizationalUnit <OrganizationalUnitIdParameter>] [-ReadFromDomainController <SwitchParameter>] [-ResultSize <Unlimited>] [-SortBy <String>]

Examples

EXAMPLE 1

This example retrieves a complete list of remote mailboxes for the entire Exchange organization.

Copy Code
Get-RemoteMailbox

EXAMPLE 2

This example uses alternate credentials to retrieve a list of one or more mail-enabled users with mailboxes in the service. This is useful if the account you typically use doesn't have administrative permissions. The credentials are used to access the on-premises Active Directory domain controllers.

First, run the following command to prompt you for your credentials, and then store them in a variable.

Copy Code
$Credentials = Get-Credential

Then retrieve a list of remote mailboxes using the credentials you provided by using the following command.

Copy Code
Get-RemoteMailbox -Credential $Credentials

Detailed Description

The Get-RemoteMailbox cmdlet retrieves the mail-related attributes of a mail user in the on-premises Active Directory. It doesn't retrieve the attributes of the associated mailbox in the service. Most of the mail-related attributes of the on-premises mail user and the associated mailbox in the service should be the same. However, the mailbox in the service has additional attributes that you can't view by using the Get-RemoteMailbox cmdlet. To view the attributes of the mailbox, you must instead either view the mailbox by opening the appropriate forest in the Exchange Administration Center or connect to the service using the Exchange Management Shell and use the Get-Mailbox cmdlet.

You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "Remote mailboxes" entry in the Recipients Permissions topic.

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 searched are:

  • CommonName (CN)

  • DisplayName

  • FirstName

  • LastName

  • Alias

Archive

Optional

System.Management.Automation.SwitchParameter

The Archive switch specifies whether to return information about the recipient's archive mailbox.

Credential

Optional

System.Management.Automation.PSCredential

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

This parameter requires the creation and passing of a credential object. This credential object is created by using the Get-Credential cmdlet. For more information, see Get-Credential.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

The DomainController parameter specifies the fully qualified domain name (FQDN) of the domain controller that retrieves data from Active Directory.

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.

Identity

Optional

Microsoft.Exchange.Configuration.Tasks.RemoteMailboxIdParameter

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

  • GUID

  • Distinguished name (DN)

  • Domain\Account

  • User principal name (UPN)

  • LegacyExchangeDN

  • SmtpAddress

  • Alias

IgnoreDefaultScope

Optional

System.Management.Automation.SwitchParameter

The IgnoreDefaultScope parameter instructs the command to ignore the default recipient scope setting for the Exchange Management Shell session and use the entire forest as the scope. This allows the command to access Active Directory objects that aren't currently in the default scope. Using the IgnoreDefaultScope parameter introduces the following restrictions:

  • You can't use the DomainController parameter. The command uses an appropriate global catalog server automatically.

  • You can only use the DN for the Identity parameter. Other forms of identification, such as alias, aren't accepted.

  • You can't use the OnPremisesOrganizationalUnit and Identity parameters together.

  • You can't use the Credential parameter.

OnPremisesOrganizationalUnit

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

The OnPremisesOrganizationalUnit parameter specifies a container in the on-premises organization 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 don't use this parameter, it's 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 servers that run Exchange.

ResultSize

Optional

Microsoft.Exchange.Data.Unlimited

The ResultSize parameter specifies the maximum number of results to return. If you want to return all mailboxes that match the query, 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

  • Display name

  • Name

The results are sorted in ascending order.

Input Types

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn’t accept input data.

Return Types

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn’t return data.