Get-ADUser PowerShell - Get AD user details using email address


Posted on : Fri, 2nd Oct 15 02:49 pm UTC
2314 votes

Get-ADUser PowerShell command

Get-ADUser is a PowerShell cmdlet which gets a user or performs a search to retrieve multiple user objects from Active Directory.
Start Windows PowerShell or SharePoint Management Shell (right click - run as administrator) and use this command.

Syntax

Get-ADUser -Filter [-ResultPageSize ] [-ResultSetSize ] [-SearchBase ] [-SearchScope { | | }] [-SearchScope { | | }] [-AuthType { | }] [-Credential ] [-Partition ] [-Properties ] [-Server ] []


Example

Replace the email address with your original email-id before running this command.

Name : Get-ADUser - How to get Active Directory user details based on email address
  
Get-ADUser -Filter {Emailaddress -eq [email protected]'}
  

You can modify command as below to get only desired property. Below example gets only Display Name, this will return/display only the Name of user.

Get-ADUser -Filter {Emailaddress -eq [email protected]'} -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 above script.

Import-Module ServerManager
Add-WindowsFeature RSAT-AD-PowerShell

import-module activedirectory

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +