Get-ADUser

Description

Gets one or more Active Directory users.

Command
Get-ADUser
Examples
Get a specific user by their SAM account name
Get-ADUser -Identity 'jdoe'
Get all users in a specific OU
Get-ADUser -Filter * -SearchBase 'OU=Finance,DC=example,DC=com'
Get all enabled users and show their email addresses
Get-ADUser -Filter 'Enabled -eq $true' -Properties EmailAddress | Select-Object Name, EmailAddress
Parameters
Parameter Type Required Description
-Identity <ADUser> string No Specifies an Active Directory user object by providing one of the user's properties (sAMAccountName, distinguished name, SID, GUID).
-Filter <String> string No Specifies a query string that retrieves Active Directory objects. Uses PowerShell Expression Language syntax.
-Properties <String[]> string No Specifies the properties of the returned object to retrieve from the server.
-SearchBase <String> string No Specifies the Active Directory path to start the search (e.g., 'OU=Finance,DC=example,DC=com').
Command Info
Category: User Management
Type: Windows_ad
Views: 19
Status: Active
Tags
ad powershell user query get