Applies to: Exchange Server 2013, Exchange Online
Topic Last Modified: 2012-07-11
Use the Get-User cmdlet to retrieve all users in the forest that match the specified conditions.
For information about the parameter sets in the Syntax section below, see Syntax.
Syntax
Get-User [-Anr <String>] <COMMON
PARAMETERS>
|
Get-User [-Identity <UserIdParameter>] <COMMON
PARAMETERS>
|
COMMON PARAMETERS: [-AccountPartition
<AccountPartitionIdParameter>] [-Arbitration
<SwitchParameter>] [-ConsumerNetID <NetID>]
[-Credential <PSCredential>] [-DomainController <Fqdn>]
[-Filter <String>] [-IgnoreDefaultScope
<SwitchParameter>] [-Organization
<OrganizationIdParameter>] [-OrganizationalUnit
<OrganizationalUnitIdParameter>] [-PublicFolder
<SwitchParameter>] [-ReadFromDomainController
<SwitchParameter>] [-RecipientTypeDetails
<RecipientTypeDetails[]>] [-ResultSize <Unlimited>]
[-SoftDeletedUser <SwitchParameter>] [-SortBy
<String>]
|
Examples
EXAMPLE 1
This example retrieves information about users in the Marketing OU.
Copy Code | |
---|---|
Get-User -OrganizationalUnit "Marketing" |
EXAMPLE 2
This example uses the Filter parameter to retrieve information about all users that have the word Manager at the end of their title.
Copy Code | |
---|---|
Get-User -Filter "Title -like '*Manager'" |
Detailed Description
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:
|
||
Arbitration |
Optional |
System.Management.Automation.SwitchParameter |
The Arbitration parameter specifies that the mailbox for which you are executing the command is an arbitration mailbox. Arbitration mailboxes are used for managing approval workflow. For example, an arbitration mailbox is used for handling moderated recipients and distribution group membership approval. |
||
ConsumerNetID |
Optional |
Microsoft.Exchange.Data.NetID |
This parameter is reserved for internal Microsoft use. |
||
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.UserIdParameter |
The Identity parameter specifies the identity of the user object. This parameter accepts the following values:
|
||
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:
|
||
Organization |
Optional |
Microsoft.Exchange.Configuration.Tasks.OrganizationIdParameter |
The Organization 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). |
||
PublicFolder |
Optional |
System.Management.Automation.SwitchParameter |
The PublicFolder parameter specifies that the user object for which you're executing the command is a public folder mailbox. Public folder mailboxes are specially designed mailboxes to store the hierarchy and content of public folders. This parameter is required to retrieve information for a public folder mailbox. |
||
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.
|
||
RecipientTypeDetails |
Optional |
Microsoft.Exchange.Data.Directory.Recipient.RecipientTypeDetails[] |
The RecipientTypeDetails parameter specifies the type of
recipients returned. Recipient types are divided into types and
subtypes. Each recipient type contains all common properties for
all subtypes. For example, the type You can use the following values:
|
||
ResultSize |
Optional |
Microsoft.Exchange.Data.Unlimited |
The ResultSize parameter specifies the maximum number of results to return. |
||
SoftDeletedUser |
Optional |
System.Management.Automation.SwitchParameter |
This parameter is reserved for internal Microsoft use. |
||
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.