Link to home
Start Free TrialLog in
Avatar of jamorlando
jamorlandoFlag for United States of America

asked on

Import .csv file into Exchange Distribution Group

Seems like a simple enough question, but I can't figure this out, nor can I find anything on google.

I have a spreadsheet with over 500 email addresses.  I would like to make this a Distribution Group in Exchange.  How can I do this, without entering each e-mail manually?

Thanks,
Jamie
ASKER CERTIFIED SOLUTION
Avatar of Razi_Ahmed
Razi_Ahmed
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jamorlando

ASKER

No dice, here is the output I got:
[PS] C:\Documents and Settings\Administrator.IKS>Type C:\test.csv | ForEach-Object -Process { Add-DistributionGroupMember -DL Name -Member $_ }
Add-DistributionGroupMember : A parameter cannot be found that matches parameter name 'DL'.
At line:1 char:77
+ Type C:\test.csv | ForEach-Object -Process { Add-DistributionGroupMember -DL
 <<<< Name -Member $_ }
Add-DistributionGroupMember : A parameter cannot be found that matches parameter name 'DL'.
At line:1 char:77
+ Type C:\test.csv | ForEach-Object -Process { Add-DistributionGroupMember -DL
 <<<< Name -Member $_ }

Do I first need to create a blank Distribution Group?  Do the email addresses already need to be in Active Directory?
yes you have to first create a blank DL.
Also In the shell command I gave "DL Name"  is the name of the list, you need to change it.
Nice!  It works, however, it looks like the email addresses already have to exist in Active Directory.  Here's an example of an error that I got while running this.  Do these emails need to be in AD, and if so is there an easy way to get them in?
Thanks!

Add-DistributionGroupMember : Object "test123@test.com" could not be found. Please make sure that it was spelled correctly or specify a different object.
At line:1 char:73
+ Type C:\test.csv | ForEach-Object -Process { Add-DistributionGroupMember  <<<
< testtest -Member $_ }
yes.. if we add a memeber in DL it has to be either a mailbox or mail enabled user. We cannot add an external email address.
Razi, I am going to raise the points to 500 to ask a related question.

About half of these names are already contacts in Active Directory and imported properly, while the other ones aren't in there yet.

Can you provide with with a command to input a list of email addresses from a file and add them if they're not already added?
Jamorlando,

First, In a DL we can only add those user's who are visible in GAL that means accounts need to be created and replicated in Active Directory.
Second, the same command should work once the other accounts are created in the list. It will just ignore the others who were added already.

Hope I Answered the question :)
You can bulk create user's using the steps suggested here.
http://exchangepedia.com/blog/2006/11/exchange-server-2007-bulk-creation-of.html

a) Creat a CSV with 3 columns
Alias,Name,UPN
User_One,User One,userone@yourUPNsuffix.com

b) Use the cmdlet
Import-CSV CreateRecipients.csv | foreach {new-mailbox -alias $_.alias -name $_.name -userPrincipalName $_.UPN -database "Mailbox Database" -org Users -Password $Password}

After that you can run razi's steps above to import users in DL.

thanks


Thanks Sunny, I'm not interested in creating mailboxes for them.
I just need to create contacts in Active Directory.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial