As an Exchange and 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.

 

exchangeManagementshell

 

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.

New-DistributionGroup -Name “GroupX” -OrganizationalUnit  “cornetser.com/Users”  -SamAccountName  “GroupX” -Type “Distribution”

 

createNewgroup createNewgroup

 

Next lets list out our existing Distribution Group to see who we will be coping to the new group.

Get-DistributionGroupMember “Florida”

 

 

list-group-members

 

Now we need to add the Distribution Group Members from “Florida” distribution group to the new GroupX distribution group.

Get-DistributionGroupMember “Florida” | Get-Mailbox | Add-DistributionGroupMember “GroupX”

copyGroupMemberstoNewGroup

To add more groups to the GroupX distribution groups rerun the same command as above with new group name to copy from in the “Get-DistributionGroupMember” 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.

 

 

Enjoy,

Cubert  8)

 

 

 

 

 

 

 

10 Responses to “Copy members from one Distribution Group to another Distribution Group in PowerShell”

  1. Aziz says:

    Thanks this was a big help!!!

  2. Isabelle says:

    Hi to all, it’s actually a nice for me to pay a quick visit this site, it
    contains helpful Information.

  3. I just like the valuable info you provide for your articles.
    I’ll bookmark your blog and check again right here frequently.
    I’m rather certain I will be told a lot of new stuff proper right here!
    Best of luck for the following!

  4. May I just say what a comfort to find somebody that truly understands what they are talking about online.
    You definitely realize how to bring an issue to
    light and make it important. More and more people must
    look at this and understand this side of your story. It’s surprising you aren’t more popular because you most certainly possess
    the gift.

  5. Hemant says:

    Getting below error

    The input object cannot be bound to any parameters for the command either because the command does not take pipeline
    input or the input and its properties do not match any of the parameters that take pipeline input.
    + CategoryInfo : InvalidArgument: (Robin Dsouza:PSObject) [Add-DistributionGroupMember], ParameterBinding
    Exception
    + FullyQualifiedErrorId : InputObjectNotBound,Add-DistributionGroupMember
    + PSComputerName : outlook.office365.com

  6. Adonis says:

    Pipes may not work for a remote Powershell session. Try running this as a script in Powershell ISE:

    $distrouser = Get-DistributionGroupMember “Distro2Export”
    Foreach ($u in $distrouser) {Add-DistributionGroupMember -Identity “Distro2Import” -Member $u.Name}

  7. Tobias says:

    I assume this works with Office365-groups as well? We need to convert 20 different Office365-groups (each one has around 30 members!) to mail-enabled security groups.

    Since there is no way to do this in Office365 we’re planning to copy the members of each one of these 20 Office365-groups to their related new mail-enabled security group using Powershell. Is this possible?
    Any help appreciated, thank you!!

  8. Trisha says:

    I’m impressed, I have to admit. Seldom do I come across a blog that’s both equally educative and interesting, and let me
    tell you, you have hit the nail on the head. The problem is something not enough people are speaking intelligently about.
    I am very happy that I came across this in my
    search for something relating to this.

  9. Very good post. I definitely appreciate this site. Stick
    with it!

  10. This website really has all the information and facts I
    wanted about this subject and didn?t know who to ask.

Leave a Reply