{"id":2014,"date":"2017-01-09T21:47:55","date_gmt":"2017-01-09T21:47:55","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=2014"},"modified":"2017-01-09T21:47:55","modified_gmt":"2017-01-09T21:47:55","slug":"copy-members-from-one-distribution-group-to-another-distribution-group-in-powershell","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=2014","title":{"rendered":"Copy members from one Distribution Group to another Distribution Group in PowerShell"},"content":{"rendered":"<p>As an Exchange\u00a0and Active Directory administrator you may be asked at some point to make a new distribution group from one or more other distribution groups. Exchange 2010 and PowerShell make this a very easy task. So to get started log in to your exchange server and open your Exchange Management Console.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1367\" src=\"http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/exchangeManagementshell.png\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" srcset=\"http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/exchangeManagementshell.png 770w, http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/exchangeManagementshell-300x124.png 300w\" alt=\"exchangeManagementshell\" width=\"770\" height=\"320\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Now we need to create the new distribution group by running the following command. Replace (GroupX) with the name of the group you want to create, replace the OrganizationalUnit with the location you want the group to show up in under Active Directory and change the SAM account name to your group name.<\/p>\n<blockquote><p>New-DistributionGroup\u00a0-Name\u00a0\u201cGroupX\u201d -OrganizationalUnit\u00a0 \u201ccornetser.com\/Users\u201d\u00a0 -SamAccountName\u00a0 \u201cGroupX\u201d -Type \u201cDistribution\u201d<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1368\" src=\"http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/createNewgroup.png\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" srcset=\"http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/createNewgroup.png 961w, http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/createNewgroup-300x13.png 300w\" alt=\"createNewgroup\" width=\"961\" height=\"43\" \/><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1369\" src=\"http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/createNewgroup1.png\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" srcset=\"http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/createNewgroup1.png 961w, http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/createNewgroup1-300x36.png 300w\" alt=\"createNewgroup\" width=\"961\" height=\"117\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Next lets list out our existing Distribution Group to see who we will be coping to the new group.<\/p>\n<blockquote><p>Get-DistributionGroupMember \u201cFlorida\u201d<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1370\" src=\"http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/list-group-members.png\" sizes=\"auto, (max-width: 619px) 100vw, 619px\" srcset=\"http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/list-group-members.png 619w, http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/list-group-members-300x90.png 300w\" alt=\"list-group-members\" width=\"619\" height=\"186\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Now we need to add the Distribution Group Members from \u201cFlorida\u201d distribution group to the new GroupX distribution group.<\/p>\n<blockquote><p>Get-DistributionGroupMember\u00a0\u201cFlorida\u201d | Get-Mailbox | Add-DistributionGroupMember\u00a0\u201cGroupX\u201d<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1371\" src=\"http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/copyGroupMemberstoNewGroup.png\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" srcset=\"http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/copyGroupMemberstoNewGroup.png 942w, http:\/\/www.squidworks.net\/wp-content\/uploads\/2013\/07\/copyGroupMemberstoNewGroup-300x8.png 300w\" alt=\"copyGroupMemberstoNewGroup\" width=\"942\" height=\"27\" \/><\/p>\n<p>To add more groups to the GroupX\u00a0distribution groups rerun the same command as above with new group\u00a0name\u00a0to copy from in the \u201cGet-DistributionGroupMember\u201d section. Any duplicate members will error out as a duplicate and will be skipped as the list is copied so you will have a nice clean list once completed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As an Exchange\u00a0and Active Directory administrator you may be asked at some point to make a new distribution group from one or more other distribution groups. Exchange 2010 and PowerShell make this a very easy task. So to get started log in to your exchange server and open your Exchange Management Console. &nbsp; &nbsp; Now [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,22,58,62,59],"tags":[],"class_list":["post-2014","post","type-post","status-publish","format-standard","hentry","category-exchange-2007","category-exchange-2010","category-exchange-2013","category-microsoft-exchange-server-2016","category-powershell"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2014","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=2014"}],"version-history":[{"count":1,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2014\/revisions"}],"predecessor-version":[{"id":2015,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2014\/revisions\/2015"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}