Tuesday, May 8, 2012

Powershell: Get a list with Username and Mail address from AD

Get a list with Username and Mail address. The output of the query will be saved in "c:\mail.txt".


(Import-Module ActiveDirectory required)

Sample Output:

SamAccountName          Mail
--------------                       ----
User1                            User1@corp.de
User2                            User2@corp.nl
User3                            User3@corp.fr

No comments:

Post a Comment