Thursday 19 July 2012

Import users form a CSV file to Distribution Group

I have been getting asked lately on how to due bulk user imports into Exchange for various tasks.

The below example will use the user Alias field to add users to a Distribution group.  You can use this method to do other things like make new mailboxes and such.  All you need to do is change the command.  the CSV file should be comma delineated and the first line should say alias since that is what I am using.

Also note I used the alias field you can also use email addresses etc.

Import-CSV c:\users.csv | ForEach {Add-DistributionGroupMember -Identity "DL Name" -Member $_.alias}

Monday 16 July 2012

How to get members of a Dynamic Distribution Group in Exchange 2010

Sometimes, we are asked to send a report off which members are in a DL.  If the DL is Dynamic this can be tricky.


    $1 = Get-DynamicDistributionGroup "groupname"
    Get-Recipient -resultsize unlimited -RecipientPreviewFilter $1.recipientfilter -OrganizationalUnit $1.organizatunit

 The above commands will get the list of members.  What I did was make a variable of $1 for the dynamic DL.  This saved me typing time when I ran the command to get the members.