{"id":138,"date":"2019-02-20T18:49:00","date_gmt":"2019-02-20T18:49:00","guid":{"rendered":"https:\/\/www.atlanta247.com\/blog\/?p=138"},"modified":"2019-11-20T16:07:16","modified_gmt":"2019-11-20T16:07:16","slug":"simple-script-to-dump-the-members-of-many-groups-named-similarly","status":"publish","type":"post","link":"https:\/\/www.atlanta247.com\/blog\/2019\/02\/20\/simple-script-to-dump-the-members-of-many-groups-named-similarly\/","title":{"rendered":"Simple Script to Dump the members of many groups named similarly"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>param(&#91;Parameter(Mandatory=$true)]$GroupPrefix)\n# Just specify the group prefix and the script will query all groups and create a csv file named with the prefix in the temp folder.\n\n# This has a dependancy on Quest Powershell tools\nadd-pssnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue\n\n# get the data\nGet-QADGroup -Name \"$GroupPrefix*\" | foreach {$group = $_; Get-QADGroupMember -Identity $_ } | Get-QADUser | foreach {New-Object PSObject -Property @{Group=$group.Name; GroupDesc=$group.Description; SamAccountName=$_.SamAccountName;LastName=$_.LastName;FirstName=$_.FirstName;Email=$_.email;DisplayName=$_.DisplayName;Department=$_.Department; DN=$_.DN; Manager=$_.Manager}} | Export-Csv c:\\TEMP\\$GroupPrefix.csv\n\n$temp = $null\n$temp = Import-Csv c:\\TEMP\\$GroupPrefix.csv\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-138","post","type-post","status-publish","format-standard","hentry","category-powershell"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.atlanta247.com\/blog\/wp-json\/wp\/v2\/posts\/138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.atlanta247.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.atlanta247.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.atlanta247.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.atlanta247.com\/blog\/wp-json\/wp\/v2\/comments?post=138"}],"version-history":[{"count":1,"href":"https:\/\/www.atlanta247.com\/blog\/wp-json\/wp\/v2\/posts\/138\/revisions"}],"predecessor-version":[{"id":139,"href":"https:\/\/www.atlanta247.com\/blog\/wp-json\/wp\/v2\/posts\/138\/revisions\/139"}],"wp:attachment":[{"href":"https:\/\/www.atlanta247.com\/blog\/wp-json\/wp\/v2\/media?parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.atlanta247.com\/blog\/wp-json\/wp\/v2\/categories?post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.atlanta247.com\/blog\/wp-json\/wp\/v2\/tags?post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}