Get-ADUser PowerShell command can be used to get a user or multiple user objects from Active Directory.
Start Windows PowerShell or SharePoint Management Shell (right click - run as administrator) and execute the command.
✔️ Syntax of Get-ADUser PowerShell command
Get-ADUser -Filter [-ResultPageSize ] [-ResultSetSize ] [-SearchBase ] [-SearchScope { | | }] [-SearchScope { | | }] [-AuthType { | }] [-Credential ] [-Partition ] [-Properties ] [-Server ] []
✔️ Get-ADUser PowerShell command to get user profile
Replace the email address with your original email-id before running this command.Get-ADUser -Filter {Emailaddress -eq 'user@code2care.com'}
✔️ Get selective user properties using Get-ADUser
You can modify the command to get only the desired property. Below example gets only Display Name, this will return only the Name of the user.Get-ADUser -Filter {Emailaddress -eq 'user@code2care.com'} -Properties Name | Select Name
⛏️ Troubleshooting
If you get an error The term 'Get-ADUser' is not recognized as the name of a cmdlet, run below commands before executing the above script.Import-Module ServerManager
Add-WindowsFeature RSAT-AD-PowerShell
import-module activedirectory
This is not an AI-generated article but is demonstrated by a human.
Please support independent contributors like Code2care by donating a coffee.
Buy me a coffee!

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!