{"id":3731,"date":"2018-11-01T23:12:01","date_gmt":"2018-11-01T23:12:01","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=3731"},"modified":"2018-11-01T23:12:01","modified_gmt":"2018-11-01T23:12:01","slug":"powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups","title":{"rendered":"Powershell &#8211; List group Memberships in 365 of Distribution groups and Unified groups"},"content":{"rendered":"<p>&nbsp;<\/p><p>[pastacode lang=&#8221;markdown&#8221; manual=&#8221;%24groups%3DGet-UnifiedGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22&#8212;%20Members%20&#8212;%22%0A%20%20%20%20%24membersOfGroup%3DGet-UnifiedGroupLinks%20-Identity%20%24group.Identity%20-LinkType%20Members%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D%0A%0A%0A%24groups%3DGet-DistributionGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22&#8212;%20Members%20&#8212;%22%0A%20%20%20%20%24membersOfGroup%3DGet-DistributionGroupMember%20-Identity%20%24group.Identity%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D&#8221; message=&#8221;&#8221; highlight=&#8221;&#8221; provider=&#8221;manual&#8221;\/]<\/p>","protected":false},"excerpt":{"rendered":"<p>&nbsp;[pastacode lang=&#8221;markdown&#8221; manual=&#8221;%24groups%3DGet-UnifiedGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22&#8212;%20Members%20&#8212;%22%0A%20%20%20%20%24membersOfGroup%3DGet-UnifiedGroupLinks%20-Identity%20%24group.Identity%20-LinkType%20Members%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D%0A%0A%0A%24groups%3DGet-DistributionGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22&#8212;%20Members%20&#8212;%22%0A%20%20%20%20%24membersOfGroup%3DGet-DistributionGroupMember%20-Identity%20%24group.Identity%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D&#8221; message=&#8221;&#8221; highlight=&#8221;&#8221; provider=&#8221;manual&#8221;\/]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[],"class_list":["post-3731","post","type-post","status-publish","format-standard","hentry","category-code"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"[pastacode lang=&quot;markdown&quot; manual=&quot;%24groups%3DGet-UnifiedGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-UnifiedGroupLinks%20-Identity%20%24group.Identity%20-LinkType%20Members%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D%0A%0A%0A%24groups%3DGet-DistributionGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-DistributionGroupMember%20-Identity%20%24group.Identity%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D&quot; message=&quot;&quot; highlight=&quot;&quot; provider=&quot;manual&quot;\/]\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"paris\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Welcome to Pariswells.com |\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Powershell \u2013 List group Memberships in 365 of Distribution groups and Unified groups | Welcome to Pariswells.com\" \/>\n\t\t<meta property=\"og:description\" content=\"[pastacode lang=&quot;markdown&quot; manual=&quot;%24groups%3DGet-UnifiedGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-UnifiedGroupLinks%20-Identity%20%24group.Identity%20-LinkType%20Members%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D%0A%0A%0A%24groups%3DGet-DistributionGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-DistributionGroupMember%20-Identity%20%24group.Identity%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D&quot; message=&quot;&quot; highlight=&quot;&quot; provider=&quot;manual&quot;\/]\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2018-11-01T23:12:01+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2018-11-01T23:12:01+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Powershell \u2013 List group Memberships in 365 of Distribution groups and Unified groups | Welcome to Pariswells.com\" \/>\n\t\t<meta name=\"twitter:description\" content=\"[pastacode lang=&quot;markdown&quot; manual=&quot;%24groups%3DGet-UnifiedGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-UnifiedGroupLinks%20-Identity%20%24group.Identity%20-LinkType%20Members%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D%0A%0A%0A%24groups%3DGet-DistributionGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-DistributionGroupMember%20-Identity%20%24group.Identity%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D&quot; message=&quot;&quot; highlight=&quot;&quot; provider=&quot;manual&quot;\/]\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/code\\\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#article\",\"name\":\"Powershell \\u2013 List group Memberships in 365 of Distribution groups and Unified groups | Welcome to Pariswells.com\",\"headline\":\"Powershell &#8211; List group Memberships in 365 of Distribution groups and Unified groups\",\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\"},\"datePublished\":\"2018-11-01T23:12:01+00:00\",\"dateModified\":\"2018-11-01T23:12:01+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/code\\\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/code\\\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#webpage\"},\"articleSection\":\"Code\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/code\\\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pariswells.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/code#listItem\",\"name\":\"Code\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/code#listItem\",\"position\":2,\"name\":\"Code\",\"item\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/code\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/code\\\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#listItem\",\"name\":\"Powershell &#8211; List group Memberships in 365 of Distribution groups and Unified groups\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/code\\\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#listItem\",\"position\":3,\"name\":\"Powershell &#8211; List group Memberships in 365 of Distribution groups and Unified groups\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/code#listItem\",\"name\":\"Code\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\",\"name\":\"Welcome to Pariswells.com\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris\",\"name\":\"paris\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/code\\\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93b8ee3f592ac401167f870452bd82d43de80152cd3524e2853403658ada9984?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"paris\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/code\\\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#webpage\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/code\\\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups\",\"name\":\"Powershell \\u2013 List group Memberships in 365 of Distribution groups and Unified groups | Welcome to Pariswells.com\",\"description\":\"[pastacode lang=\\\"markdown\\\" manual=\\\"%24groups%3DGet-UnifiedGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-UnifiedGroupLinks%20-Identity%20%24group.Identity%20-LinkType%20Members%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D%0A%0A%0A%24groups%3DGet-DistributionGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-DistributionGroupMember%20-Identity%20%24group.Identity%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D\\\" message=\\\"\\\" highlight=\\\"\\\" provider=\\\"manual\\\"\\\/]\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/code\\\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"datePublished\":\"2018-11-01T23:12:01+00:00\",\"dateModified\":\"2018-11-01T23:12:01+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/\",\"name\":\"Welcome to Pariswells.com\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Powershell \u2013 List group Memberships in 365 of Distribution groups and Unified groups | Welcome to Pariswells.com","description":"[pastacode lang=\"markdown\" manual=\"%24groups%3DGet-UnifiedGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-UnifiedGroupLinks%20-Identity%20%24group.Identity%20-LinkType%20Members%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D%0A%0A%0A%24groups%3DGet-DistributionGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-DistributionGroupMember%20-Identity%20%24group.Identity%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D\" message=\"\" highlight=\"\" provider=\"manual\"\/]","canonical_url":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#article","name":"Powershell \u2013 List group Memberships in 365 of Distribution groups and Unified groups | Welcome to Pariswells.com","headline":"Powershell &#8211; List group Memberships in 365 of Distribution groups and Unified groups","author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"publisher":{"@id":"https:\/\/pariswells.com\/blog\/#organization"},"datePublished":"2018-11-01T23:12:01+00:00","dateModified":"2018-11-01T23:12:01+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#webpage"},"isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#webpage"},"articleSection":"Code"},{"@type":"BreadcrumbList","@id":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/pariswells.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/code#listItem","name":"Code"}},{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/code#listItem","position":2,"name":"Code","item":"https:\/\/pariswells.com\/blog\/category\/code","nextItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#listItem","name":"Powershell &#8211; List group Memberships in 365 of Distribution groups and Unified groups"},"previousItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#listItem","position":3,"name":"Powershell &#8211; List group Memberships in 365 of Distribution groups and Unified groups","previousItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/code#listItem","name":"Code"}}]},{"@type":"Organization","@id":"https:\/\/pariswells.com\/blog\/#organization","name":"Welcome to Pariswells.com","url":"https:\/\/pariswells.com\/blog\/"},{"@type":"Person","@id":"https:\/\/pariswells.com\/blog\/author\/paris#author","url":"https:\/\/pariswells.com\/blog\/author\/paris","name":"paris","image":{"@type":"ImageObject","@id":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/93b8ee3f592ac401167f870452bd82d43de80152cd3524e2853403658ada9984?s=96&d=mm&r=g","width":96,"height":96,"caption":"paris"}},{"@type":"WebPage","@id":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#webpage","url":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups","name":"Powershell \u2013 List group Memberships in 365 of Distribution groups and Unified groups | Welcome to Pariswells.com","description":"[pastacode lang=\"markdown\" manual=\"%24groups%3DGet-UnifiedGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-UnifiedGroupLinks%20-Identity%20%24group.Identity%20-LinkType%20Members%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D%0A%0A%0A%24groups%3DGet-DistributionGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-DistributionGroupMember%20-Identity%20%24group.Identity%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D\" message=\"\" highlight=\"\" provider=\"manual\"\/]","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups#breadcrumblist"},"author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"creator":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"datePublished":"2018-11-01T23:12:01+00:00","dateModified":"2018-11-01T23:12:01+00:00"},{"@type":"WebSite","@id":"https:\/\/pariswells.com\/blog\/#website","url":"https:\/\/pariswells.com\/blog\/","name":"Welcome to Pariswells.com","inLanguage":"en-US","publisher":{"@id":"https:\/\/pariswells.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Welcome to Pariswells.com |","og:type":"article","og:title":"Powershell \u2013 List group Memberships in 365 of Distribution groups and Unified groups | Welcome to Pariswells.com","og:description":"[pastacode lang=&quot;markdown&quot; manual=&quot;%24groups%3DGet-UnifiedGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-UnifiedGroupLinks%20-Identity%20%24group.Identity%20-LinkType%20Members%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D%0A%0A%0A%24groups%3DGet-DistributionGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-DistributionGroupMember%20-Identity%20%24group.Identity%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D&quot; message=&quot;&quot; highlight=&quot;&quot; provider=&quot;manual&quot;\/]","og:url":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups","article:published_time":"2018-11-01T23:12:01+00:00","article:modified_time":"2018-11-01T23:12:01+00:00","twitter:card":"summary","twitter:title":"Powershell \u2013 List group Memberships in 365 of Distribution groups and Unified groups | Welcome to Pariswells.com","twitter:description":"[pastacode lang=&quot;markdown&quot; manual=&quot;%24groups%3DGet-UnifiedGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-UnifiedGroupLinks%20-Identity%20%24group.Identity%20-LinkType%20Members%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D%0A%0A%0A%24groups%3DGet-DistributionGroup%0A%0Aforeach(%24group%20in%20%24groups)%0A%7B%0A%20%20%20%20Write-Host%20%22************************************************%22%0A%20%20%20%20Write-Host%20%22GroupName%3A%20%22%20%20%24group.DisplayName%0A%20%20%20%20Write-Host%20%22Email%3A%20%22%20%20%24group.primarySMTPAddress%0A%20%20%20%20Write-Host%20%22---%20Members%20---%22%0A%20%20%20%20%24membersOfGroup%3DGet-DistributionGroupMember%20-Identity%20%24group.Identity%0A%20%20%20%20foreach(%24member%20in%20%24membersOfGroup)%0A%20%20%20%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20Get-Recipient%20-Identity%20%24member.Name%20%7C%20select%20PrimarySmtpAddress%20%7CFormat-Wide%20%0A%20%20%20%20%7D%0A%20%20%20%20%20%0A%7D&quot; message=&quot;&quot; highlight=&quot;&quot; provider=&quot;manual&quot;\/]"},"aioseo_meta_data":{"post_id":"3731","title":null,"description":null,"keywords":null,"keyphrases":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-21 05:33:27","updated":"2022-09-16 16:53:49","primary_term":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/pariswells.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/pariswells.com\/blog\/category\/code\" title=\"Code\">Code<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tPowershell \u2013 List group Memberships in 365 of Distribution groups and Unified groups\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/pariswells.com\/blog"},{"label":"Code","link":"https:\/\/pariswells.com\/blog\/category\/code"},{"label":"Powershell &#8211; List group Memberships in 365 of Distribution groups and Unified groups","link":"https:\/\/pariswells.com\/blog\/code\/powershell-list-group-memberships-in-365-of-distribution-groups-and-unified-groups"}],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/3731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=3731"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/3731\/revisions"}],"predecessor-version":[{"id":3732,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/3731\/revisions\/3732"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=3731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=3731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=3731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}