{"id":3601,"date":"2014-10-24T12:55:22","date_gmt":"2014-10-24T10:55:22","guid":{"rendered":"http:\/\/dollarunderscore.azurewebsites.net\/?p=3601"},"modified":"2017-06-05T21:38:05","modified_gmt":"2017-06-05T19:38:05","slug":"export-nested-group-structures-with-powershell","status":"publish","type":"post","link":"https:\/\/p0wershell.com\/?p=3601","title":{"rendered":"Export nested group structures with PowerShell"},"content":{"rendered":"<p>I got a request the other day for a script that can export members of nested Active Directory groups.<\/p>\n<p>They wanted the export to be more or less in the same format as a file structure.<\/p>\n<p>The results are therefor returned as strings in the following format:<br \/>\nGroup \\ SubGroup1 \\ SubGroup2 \\ User1 (SamAccountName)<br \/>\nGroup \\ SubGroup1 \\ SubGroup2 \\ User2 (SamAccountName)<br \/>\nGroup \\ SubGroup1 \\ SubGroup2 \\ User3 (SamAccountName)<\/p>\n<p>and so on. I thought that someone else might try to achieve a similiar task so <em><strong>I uploaded the code <a href=\"https:\/\/p0wershell.com\/wp-content\/uploads\/2017\/06\/Get-GroupStructure.ps1_.txt\" target=\"_blank\">here<\/a><\/strong><\/em>.<\/p>\n<p>Also, I wrote a quick and simple GUI for this, <strong><em>which is available <a href=\"https:\/\/p0wershell.com\/wp-content\/uploads\/2017\/06\/Get-GroupStructure_GUI.ps1_.txt\" target=\"_blank\">here<\/a><\/em><\/strong>, it looks like this:<\/p>\n<p><a href=\"https:\/\/p0wershell.com\/wp-content\/uploads\/2014\/10\/exportadgroupmembers.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3611\" src=\"https:\/\/p0wershell.com\/wp-content\/uploads\/2014\/10\/exportadgroupmembers.png\" alt=\"exportadgroupmembers\" width=\"382\" height=\"220\" srcset=\"https:\/\/p0wershell.com\/wp-content\/uploads\/2014\/10\/exportadgroupmembers.png 382w, https:\/\/p0wershell.com\/wp-content\/uploads\/2014\/10\/exportadgroupmembers-300x172.png 300w\" sizes=\"(max-width: 382px) 100vw, 382px\" \/><\/a><\/p>\n<p>The form makes it simpler for end users to use.<\/p>\n<p>Both requires the Active Directory module and the GUI requires PowerShell v.3 or higher.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I got a request the other day for a script that can export members of nested Active Directory groups. They wanted the export to be more or less in the same format as a file structure. The results are therefor returned as strings in the following format: Group \\ SubGroup1 \\ SubGroup2 \\ User1 (SamAccountName) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[831,141,21,151],"tags":[901,911],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3Zj0A-W5","_links":{"self":[{"href":"https:\/\/p0wershell.com\/index.php?rest_route=\/wp\/v2\/posts\/3601"}],"collection":[{"href":"https:\/\/p0wershell.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p0wershell.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p0wershell.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/p0wershell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3601"}],"version-history":[{"count":0,"href":"https:\/\/p0wershell.com\/index.php?rest_route=\/wp\/v2\/posts\/3601\/revisions"}],"wp:attachment":[{"href":"https:\/\/p0wershell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p0wershell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p0wershell.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}