Get-ADUser
Use Get-ADUser to retrieve user accounts from Active Directory by identity, filter or LDAP query.
Documentation: Microsoft Learn — get-aduser
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-ADUser [-Identity] <ADUser> [-Properties <String[]>] [-Server <String>] [-Credential <PSCredential>] [<CommonParameters>]- Stage 1Get-ADUser
-Identity -Properties -Server -Credential
Try it
Browser simulation · fictional data; no changes to your computer.
Follow the objects
Run the command to inspect each stage.
Examples
Get-ADUser -Identity jsmith
Show reference output
Illustrative output · values vary by environment
Name SamAccountName Enabled ---------- -------------- ------- Jane Smith jsmith True
Get-ADUser -Filter 'Enabled -eq $false'
Show reference output
Illustrative output · values vary by environment
Name LastLogonDate ---------------- -------------------- Temp Contractor 9/10/2026 8:42:14 AM Old Service 9/10/2026 9:03:51 AM
Get-ADUser -Filter *
Show reference output
Illustrative output · values vary by environment
Count : 2 Average : Sum : Maximum : Minimum : Property :
Parameters
Parameter definitions:
-Identity-Properties-Server-Credential
Query AD users without retrieving everything
Use -Identity for one known account and -Filter or -LDAPFilter for a directory search. -Properties requests attributes beyond the default property set; ask for the attributes your report actually needs.
Scope the query
Limit a search with -SearchBase when only one OU matters. Use -Server when you must query a particular directory server. Filtering at the directory is usually preferable to downloading every user and filtering afterward.
Interpret the result
LastLogonDate is a convenient date representation of a replicated logon timestamp, not a precise latest-authentication audit. Do not use it alone to prove that an account was never used recently.
The ActiveDirectory tools and suitable directory access are prerequisites. An empty scoped search can mean no match; an exception should be investigated separately. These examples do not modify accounts.
Updated 1 October 2026. Browser outputs are fictional; check the installed module help for your environment.
Put this command to work
Read domain users
Import ActiveDirectory first. Return all fictional AD user records.
The sandbox is visible now. Sign in with Google only when you run or check a task; commands and temporary files are discarded when you leave.
Run a command to inspect its result.
Inspect starting data
Supported syntax
Virtual files
Recap
Get-ADUser Use Get-ADUser to retrieve user accounts from Active Directory by identity, filter or LDAP query.
Next: New-ADUser