{"id":1510,"date":"2014-11-10T21:22:11","date_gmt":"2014-11-10T21:22:11","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=1510"},"modified":"2023-05-12T13:42:34","modified_gmt":"2023-05-12T18:42:34","slug":"export-a-list-of-members-from-an-active-directory-group-to-a-text-file","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=1510","title":{"rendered":"Export a list of members from an Active Directory group to a text file"},"content":{"rendered":"<p dir=\"ltr\">I needed to export a list of all the members in an active directory group today. Here are two methods which work well. The first example uses the net group command. In both examples \u2018Group Name\u2019 is the name of the group that you want to export the member list for, and memberlist.txt is the name of the output file.<\/p>\n<h2 dir=\"ltr\"><span style=\"color: #0000ff;\">net group \u201cGroup Name\u201d \/domain &gt; memberlist.txt<\/span><\/h2>\n<p dir=\"ltr\">The second example uses dsquery and dsget, which will return the full distinguished names of the user objects that are members of the group. This could be useful if you also need to know which organizational unit the members accounts reside in.<\/p>\n<h2 dir=\"ltr\"><span style=\"color: #0000ff;\">dsquery group -name \u201cGroup Name\u201d | dsget group -members &gt; memberlist.txt<\/span><\/h2>\n<p dir=\"ltr\">\n","protected":false},"excerpt":{"rendered":"<p>I needed to export a list of all the members in an active directory group today. Here are two methods which work well. The first example uses the net group command. In both examples \u2018Group Name\u2019 is the name of the group that you want to export the member list for, and memberlist.txt is the [&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],"tags":[],"class_list":["post-1510","post","type-post","status-publish","format-standard","hentry","category-ad"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1510","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=1510"}],"version-history":[{"count":3,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1510\/revisions"}],"predecessor-version":[{"id":3367,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1510\/revisions\/3367"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}