Applies to: Exchange Server 2013

Topic Last Modified: 2012-09-17

Use the Get-SecurityPrincipal cmdlet to return a list of security principals.

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

Syntax

Get-SecurityPrincipal [-Identity <ExtendedSecurityPrincipalIdParameter>] [-DomainController <Fqdn>] [-Filter <String>] [-IncludeDomainLocalFrom <SmtpDomain>] [-Organization <OrganizationIdParameter>] [-OrganizationalUnit <ExtendedOrganizationalUnitIdParameter>] [-ResultSize <Unlimited>] [-RoleGroupAssignable <SwitchParameter>] [-Types <MultiValuedProperty>]

Examples

EXAMPLE 1

This example retrieves security principals in the OU People, well-known security principals, and domain local groups from the domain Contoso.com.

Copy Code
Get-SecurityPrincipal -OrganizationalUnit OU=People,DC=Contoso,DC=com -IncludeDomainLocalFrom Contoso.com

EXAMPLE 2

This example retrieves security principals from the Legal department by using the Filter parameter. Only security principals matching the filter condition are retrieved.

Copy Code
Get-SecurityPrincipal -Filter {Department -eq "Legal"} -IncludeDomainLocalFrom Contoso.com

EXAMPLE 3

This example retrieves a single security principal explicitly specified by using the Identity parameter.

Copy Code
Get-SecurityPrincipal -Identity Administrator -IncludeDomainLocalFrom Contoso.com

EXAMPLE 4

This example retrieves well-known security principals by pipelining the results from the Get-SecurityPrincipal cmdlet to the Where-Object command. The results are pipelined to the Format-Table command. Only the Name and SID parameters are selected to be included in the final output.

Copy Code
Get-SecurityPrincipal -IncludeDomainLocalFrom Contoso.com | ? {$_.Type -eq "WellKnownSecurityPrincipal"} | ft Name,SID -AutoSize
Note:
The question mark character (?) is an alias for the Where-Object command. Ft is an alias for the Format-Table command. Both aliases are included by default in the Windows PowerShell command-line interface.

Detailed Description

Security principals are entities, such as users or security groups, which can be assigned permissions and user rights.

Note:
If the IncludeDomainLocalFrom parameter is specified along with the Filter or Identity parameters, the cmdlet doesn't return domain local security groups. This cmdlet is required for internal Exchange Administration Center functionality.

The Get-SecurityPrincipal cmdlet is used by the Exchange Administration Center in Microsoft Exchange Server 2013 to populate fields that display recipient information.

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 "Active Directory Domain Services server settings" entry in the Exchange and Shell Infrastructure Permissions topic.

Parameters

Parameter Required Type Description

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 specifies one or more attributes and their corresponding values to restrict the security principals returned by the command. When the Filter parameter is used, only those security principals matching the filter conditions are returned.

Identity

Optional

Microsoft.Exchange.Configuration.Tasks.ExtendedSecurityPrincipalIdParameter

The Identity parameter specifies the identity of the security principal. When the security principal is explicitly specified by using this parameter, no additional security principals are returned.

IncludeDomainLocalFrom

Optional

Microsoft.Exchange.Data.SmtpDomain

The IncludeDomainLocalFrom parameter specifies the FQDN of an Active Directory domain. The command returns domain local groups from the specified domain.

Organization

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationIdParameter

The Organization parameter is reserved for internal Microsoft use.

OrganizationalUnit

Optional

Microsoft.Exchange.Configuration.Tasks.ExtendedOrganizationalUnitIdParameter

The OrganizationalUnit parameter specifies an organizational unit (OU), container, or domain name. It's used to limit the results. If you use this parameter, you only get mailboxes in the OU, container, or domain that you specify, in addition to well-known security principals and domain local groups from the domain you specify in the IncludeDomainLocalFrom parameter.

ResultSize

Optional

Microsoft.Exchange.Data.Unlimited

The ResultSize parameter specifies the maximum number of objects to return. The default value is 1000. To return all objects that match the query, use the value unlimited.

RoleGroupAssignable

Optional

System.Management.Automation.SwitchParameter

The RoleGroupAssignable switch filters security principals and returns only those entities that can be assigned to an RBAC role group.

Types

Optional

Microsoft.Exchange.Data.MultiValuedProperty

The Types parameter isn't available at this time.

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.