How to fetch email address from AD given users ID

Mina Kamel 46 Reputation points


is there a way that I can obtain the email address from given user in the form of domain\ID from AD using powershell.

thanks for all the help.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,429 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andreas Baumgarten 99,376 Reputation points MVP

    Hi @Mina Kamel ,

    I answered your question already here:
    Hope this helps (not tested):

     $user = 'domain\peter'  
     $SamAccountName = $user.Split('\')[1]  
     Get-ADUser -Identity $SamAccountName -Properties EmailAddress  


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Andreas Baumgarten

    0 comments No comments

0 additional answers

Sort by: Most helpful