Applies to: Exchange Server 2013, Exchange Online

Topic Last Modified: 2012-07-11

Use the Get-UserPhoto cmdlet to view information about the user photos feature that allows users to associate a picture with their account. User photos are stored in Active Directory and appear in on-premises and cloud-based client applications, such as Microsoft Office Outlook Web App, Microsoft Office Lync, and Microsoft SharePoint.

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

Syntax

Get-UserPhoto [-Anr <String>] <COMMON PARAMETERS>
Get-UserPhoto [-Identity <MailboxIdParameter>] <COMMON PARAMETERS>
COMMON PARAMETERS: [-AccountPartition <AccountPartitionIdParameter>] [-Credential <PSCredential>] [-DomainController <Fqdn>] [-Filter <String>] [-IgnoreDefaultScope <SwitchParameter>] [-Organization <OrganizationIdParameter>] [-OrganizationalUnit <OrganizationalUnitIdParameter>] [-Preview <SwitchParameter>] [-ReadFromDomainController <SwitchParameter>] [-ResultSize <Unlimited>] [-SortBy <String>]

Examples

EXAMPLE 1

This example displays information about the user photo configured for Susan Burk.

Copy Code
Get-UserPhoto "Susan Burk"

EXAMPLE 2

This example displays information about the user photo that was uploaded to Pilar Pinilla's account, but wasn't saved.

Copy Code
Get-UserPhoto "Pilar Pinilla" -Preview

Detailed Description

The user photos feature allows users to associate a picture with their account. User photos are stored in the user's Active Directory account and in the root directory of the user's Exchange mailbox. The user photo feature must be set for a user before you can run the Get-UserPhoto cmdlet to view information about the user's photo. Otherwise, you get an error message saying the user photo doesn't exist for the specified users. Administrators use the Set-UserPhoto cmdlet or the Exchange Administration Center to configure user photos. Users can upload, preview, and save a user photo to their account by using the Outlook Web App Options page.

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 "Recipient provisioning permissions" section in the Recipients Permissions topic.

Parameters

Parameter Required Type Description

AccountPartition

Optional

Microsoft.Exchange.Configuration.Tasks.AccountPartitionIdParameter

This parameter is reserved for internal Microsoft use.

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

Credential

Optional

System.Management.Automation.PSCredential

The Credential parameter specifies the account used to read 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.MailboxIdParameter

The Identity parameter specifies the identity of the user. You can use one of the following values:

  • GUID

  • Distinguished name (DN)

  • Display name

  • 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 or GUID, aren't accepted.

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

  • You can't use the Credential parameter.

Organization

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationIdParameter

This parameter is reserved for internal Microsoft use.

OrganizationalUnit

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationalUnitIdParameter

The OrganizationalUnit parameter returns objects only from the specified organizational unit (OU).

Preview

Optional

System.Management.Automation.SwitchParameter

The Preview parameter retrieves information about the preview photo for the user account. The preview photo is the photo object that was uploaded to the user's account, but wasn't saved, for example, if a user uploads a photo in Outlook Web App Options, but doesn't save it. If you use the Preview parameter after a user photo is saved, this cmdlet returns an error saying the preview photo doesn't exist.

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 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 running Exchange.

ResultSize

Optional

Microsoft.Exchange.Data.Unlimited

The ResultSize parameter specifies the maximum number of results to return.

SortBy

Optional

System.String

The SortBy parameter specifies the attribute to sort by. This parameter sorts by a single attribute 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.