none
Bulk Add contacts to Distribution List using CSV RRS feed

  • Question

  • HI I Have added some ne contacts to AD using EMS

    Please does anyone have a script to add these to a distribution List

    I have a csv file with the display name field

    Can anyone help

    Friday, April 13, 2012 9:22 AM

Answers

  • Hi,

    If these are mail contacts, you can just follow this way to add in a distribution group:

    $contacts=get-Mailcontact

    $contacts| foreach-object{ Add-DistributionGroupMember -identity "DG Name" -Member $_.Name}

    If you use CSV files(C:\FileName.csv), included contacts like this:

    Name

    contact1

    contact2

     ...

    Then use the command in your post to add in one distribution group:

    Import-CSV C:\FileName.csv | ForEach {Add-DistributionGroupMember -Identity "DG Name" -Member $_.Name}

    Thanks,

    Evan Liu

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com  


    Evan Liu

    TechNet Community Support

    Monday, April 16, 2012 5:39 AM
    Moderator

All replies

  • you can use the Quest tools for this using a text file Example.

    Sukh

    Friday, April 13, 2012 9:53 AM
  • I used the script with the but powershell does not recognise the Add-QADGroupMember

    This is running with the AD module installed for powershell

    Friday, April 13, 2012 12:42 PM
  • Friday, April 13, 2012 12:48 PM
  • This did not work for me

    I have come across a script Import-CSV C:\FileName.csv | ForEach {Add-DistributionGroupMember -Identity "DG Name" -Member $_.Name}

    to add contacts to a distribution list but what fields/information needs to be set in the csv file?

    Thanks

    Friday, April 13, 2012 6:17 PM
  • Hi,

    If these are mail contacts, you can just follow this way to add in a distribution group:

    $contacts=get-Mailcontact

    $contacts| foreach-object{ Add-DistributionGroupMember -identity "DG Name" -Member $_.Name}

    If you use CSV files(C:\FileName.csv), included contacts like this:

    Name

    contact1

    contact2

     ...

    Then use the command in your post to add in one distribution group:

    Import-CSV C:\FileName.csv | ForEach {Add-DistributionGroupMember -Identity "DG Name" -Member $_.Name}

    Thanks,

    Evan Liu

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tngfb@microsoft.com  


    Evan Liu

    TechNet Community Support

    Monday, April 16, 2012 5:39 AM
    Moderator
  • Hi,

    Any updates on this issue?

    Thanks,

    Evan Liu

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contacttngfb@microsoft.com 


    Evan Liu

    TechNet Community Support

    Tuesday, April 17, 2012 1:31 AM
    Moderator