{"id":1983,"date":"2016-12-09T20:51:11","date_gmt":"2016-12-09T20:51:11","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=1983"},"modified":"2023-05-12T13:40:58","modified_gmt":"2023-05-12T18:40:58","slug":"how-to-export-ad-user-list-with-email-addresses","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=1983","title":{"rendered":"How to Export AD user list with email addresses"},"content":{"rendered":"<p>If you have the need to export a user list from an Active Directory group along with the user&#8217;s email address, run the following command in PowerShell as an administrator.<\/p>\n<p>If your AD has the e-mail attribute filed out:<\/p>\n<p><strong>Powershell<\/strong><\/p>\n<p><span style=\"color: #0000ff;\">Get-ADGroupMember -Identity &#8220;groupname&#8221; -Recursive |<\/span><br \/>\n<span style=\"color: #0000ff;\">Get-ADUser -Properties Mail |<\/span><br \/>\n<span style=\"color: #0000ff;\">Select-Object Name,Mail |<\/span><br \/>\n<span style=\"color: #0000ff;\">Export-CSV -Path C:\\file.csv -NoTypeInformation<\/span><\/p>\n<p><strong>Example<\/strong>:<\/p>\n<p><a href=\"http:\/\/microsoftgeek.com\/?attachment_id=1984#main\" rel=\"attachment wp-att-1984\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft  wp-image-1984\" src=\"http:\/\/microsoftgeek.com\/wp-content\/uploads\/2016\/12\/image.png\" alt=\"image\" width=\"892\" height=\"393\" srcset=\"https:\/\/microsoftgeek.com\/wp-content\/uploads\/2016\/12\/image.png 858w, https:\/\/microsoftgeek.com\/wp-content\/uploads\/2016\/12\/image-300x132.png 300w, https:\/\/microsoftgeek.com\/wp-content\/uploads\/2016\/12\/image-768x338.png 768w\" sizes=\"auto, (max-width: 892px) 100vw, 892px\" \/><\/a><\/p>\n<p>If not you can get it from Exchange too, if thats what you use. 2010:<\/p>\n<p><strong>PowerShell<\/strong><\/p>\n<p><span style=\"color: #0000ff;\">Get-DistributionGroupMember -Identity &#8220;groupname&#8221; |<\/span><br \/>\n<span style=\"color: #0000ff;\">Select-Object Name,PrimarySMTPAddress |<\/span><br \/>\n<span style=\"color: #0000ff;\">Export-CSV -Path C:\\file.csv -NoTypeInformation<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have the need to export a user list from an Active Directory group along with the user&#8217;s email address, run the following command in PowerShell as an administrator. If your AD has the e-mail attribute filed out: Powershell Get-ADGroupMember -Identity &#8220;groupname&#8221; -Recursive | Get-ADUser -Properties Mail | Select-Object Name,Mail | Export-CSV -Path C:\\file.csv [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,59],"tags":[],"class_list":["post-1983","post","type-post","status-publish","format-standard","hentry","category-ad","category-powershell"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1983","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1983"}],"version-history":[{"count":3,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1983\/revisions"}],"predecessor-version":[{"id":3366,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1983\/revisions\/3366"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}