How to Create Bulk Distribution List in Exchange 2007

How to Create Bulk Distribution List in Exchange 2007 & also add multiple member.
prashantgoreAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hilal1924Commented:
Use the Powershell command with the required parametrs:
New-DistributionList
 
Or you can go to
Exchange Manaagement Console => Recipient Configuration =>Groups
From there you can create Distribution Groups.
 http://technet.microsoft.com/en-us/library/bb125256(EXCHG.80).aspx
More Info:
http://myitforum.com/cs2/blogs/yli628/archive/2008/05/12/powershell-cmdlets-to-work-with-distribution-group-in-exchange-2007-becareful-the-difference-between-ad-and-exchange.aspx
For Dynamic Distribution Group
http://www.exchangeninjas.com/DG4ServerUsers 
Hilal
0
prashantgoreAuthor Commented:
I Want Bulk DistributionGroup Creation
I have 1500 Distribution Group to be created in Exchange 2007 in one shot.

Can be like import from *.CSV file
0
Hilal1924Commented:
Sure you can. Here is how:

Scenario: Bulk create mailboxes based on a CSV file
Shell one-liner: The following one-liner creates mailboxes for all team members listed in an Avalanche.csv file, which contains NHL Avalanche team roster information with the following column format:

    Pos,No,Player,Age,Ht,Wt,Born,Exp,Birth City

$password = Read-Host "Enter password" -AsSecureString
import-csv Avalanche.csv | foreach {new-mailbox -alias "avalanche$($_.No)" -Name $_.Player -password $password -database "Mailbox Database" -org Users -UserPrincipalName "avalanche$($_.No)@example.com"}  
More Info:
http://technet.microsoft.com/en-us/library/bb310752(EXCHG.80).aspx 
 
Hilal

$password = Read-Host "Enter password" -AsSecureString
import-csv Avalanche.csv | foreach {new-mailbox -alias "avalanche$($_.No)" -Name $_.Player -password $password -database "Mailbox Database" -org Users -UserPrincipalName "avalanche$($_.No)@example.com"}

Open in new window

0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Hilal1924Commented:
Please Disregard the Above Script. I am really sorry for the overlook, it is for creating bulk mailboxes. Though the Technet Article will work fine.
Please use this script instead:

#Adds members to specific Distribution Group
$Member =Import-CSV "C:\Members.csv"
$Member | ForEach-Object -Process {Add-distributiongroupmember $_.DG -member $_.member }
 
I again apologize for the overlook.
Hilal
0
prashantgoreAuthor Commented:
Dear Hilal1924

We are talking about Bulk DistributionGroup Creation.
I dont want to create Bulk mailboxes.
0
prashantgoreAuthor Commented:
Dear Hilal1924

You are again Wrong
We are talking about Bulk DistributionGroup Creation. Not Members

1. I need to create 1500 DistributionGroup then I will add member.

So send me a script which creates Bulk DistributionGroup.


0
Hilal1924Commented:
I posted the new Script. Please try that out.
I am positng it here again
$DG =Import-CSV "C:\book2.csv"
$Member =Import-CSV "C:\book2.csv"  
$Member | ForEach-Object -Process {Add-distributiongroupmember $_.DG -member $_.member}
 
Hilal
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hilal1924Commented:
I am again sorry for the overlook. I thought you needed to add memebers to a DL. Anyway Here is a link that will help you achieve your goal:
http://cs.mseducommunity.com/blogs/liveatedu_community_blog/archive/2009/03/22/create-a-bunch-of-standard-distribution-groups-from-a-csv-file.aspx
 I have attached the code as well.
Hilal

$records = import-csv -Path c:\groups.csv -OutVariable string
foreach ($group in $records)
{
    $this_name                 = $group.name
    $this_alias                   = $group.alias
    $this_displayname       = $group.displayname
    $this_type                   = $group.type 

# create distribution group - assigning result to variable to avoid listing the new object
%{Invoke-Command -Session $Session1 {param ($this_name,$this_alias,$this_displayname,$this_type) New-DistributionGroup -Name $this_name -Alias $this_alias -DisplayName $this_displayname -Type $this_type}-arg $this_name,$this_alias,$this_displayname,$this_type} > $results 

}

Open in new window

0
prashantgoreAuthor Commented:
Dear Hilal

Above mentioned script not working
Do you I need to put any heading in CSV file.

Can you specify data format to be entered in CSV file can you send sample CSV attachment.
Please see the attachment for error i get.
DL.jpg
0
prashantgoreAuthor Commented:
Hi Hilal

you mean to say thisname , this_alias etc.
Are headings for csv file.

Bit confisued
0
Hilal1924Commented:
You CSV File should have headings like this
Name     Alias       DisplayName          Type
 
Hilal
 
0
Hilal1924Commented:
Here it is listed better
Name,Alias,DisplayName,Type                          >> These are the headings
Chess,Chess,Chess Club,Security
Computer,Computer,Computer Club,Security
0
prashantgoreAuthor Commented:
Hi

Getting attached while running above mentioned command
Please see the attachment
dlerror.jpg
0
Hilal1924Commented:
Hi Upgrade to PowerShell v2. And you will not get this error. Also, Save the script as DistributionGroup.ps1 and then execute it.
 
Hilal
0
prashantgoreAuthor Commented:
hi
I have updated the powershell ver2
But still the same error .
Can you tell me In *.csv what should be the format

Eg :- DistributionGroup  Members

Are above mentiond heading for CSV file proper
0
Hilal1924Commented:
Hi Can you use the below Script
Import-CSV dg.csv | foreach {new-distributiongroup -name $_.name -samaccountname $_.SAM -type distribution -org Users}

Your CSV File should look like this:

Name,Sam    ====> Keep this heading
Test1,Test1
Test2,Test2
 
Else post the heading of your csv file and I will buidl a script for you.
Hilal
0
prashantgoreAuthor Commented:
I got the format as mentioned below

Eg:-  DG          Members
      System     Prashant

Now I need to add the owner of the group how to do that ?
0
Hilal1924Commented:
"I need to create 1500 DistributionGroup then I will add member." this is from your comment above.
So you wanted to create blank distribution groups from a CSV file.
hey it would really help if you can post the entire heading in comma separated values. Because to import the CSV file, Fields will be matched with attributes of a Distribution Group. The minimum requirements for a Distribution group are Alias, Name, Group Type. So you need to have at least three of these properties in your CSV file. (Group Type is Optional but It will be difficult for you to change the group type later on)
If this how your csv file looks like, DG,Members (btw You should not keep members in a heading). I can Import Distribution Group, Its Name will be whatever is under DG heading and SamAccountName (alias) will be whatever is under members heading.
Import-CSV dg.csv | foreach {new-distributiongroup -name $_.DG -samaccountname $_.Members -type distribution -org Users}
To add an owner to a Distribution Group, Just use this command
Get-DistributionGroup | Set-DistributionGroup -ManagedBy "user" ( Use this if you want to Make a user owner of all Distribution Groups)
Set-DistributionGroup -Identity "Name of DistributionGroup" -ManagedBy "user" (Use this to make a user owner of a single group.
Hilal
0
prashantgoreAuthor Commented:
Thanks but I need to add DG Owner in Bulk
Again does it have any command with csv file
0
Hilal1924Commented:
You can use this command to assign DG owners in Bulk
Import-CSV dg.csv | foreach {set-group -name $_.DG -ManagedBy $_.ManagedBy}
 
Create your csv file like this:
DG,ManagedBy
GroupName,UserName
Hilal
0
prashantgoreAuthor Commented:
Hi Hilal

Thanks for your help
Can you give me a scrip to create bulk Mail Enable Distribution Group.
Please mention the CSV heading format.
0
prashantgoreAuthor Commented:
can any body reply for above problem
0
prashantgoreAuthor Commented:
Hi Hilal

Thanks for the help provided but if you can give scrip for below mention problem. I would really appreciate you.

Thanks Again
0
prashantgoreAuthor Commented:
Hi Hilal

Thanks for the help provided but if you can give scrip for below mention problem. I would really appreciate you.

Can you give me a scrip to create bulk Mail Enable Distribution Group.
Please mention the CSV heading format.

Thanks Again
0
Hilal1924Commented:
Prashant,
I have given all the necessary scripts to create Bulk Distribution Group and it is unfortunate that ytou were not able to leverage the script usage. I think I have provided you the solution many times over and hence this question needs to be graded.
Hilal
0
Hilal1924Commented:
"The Script provided was working fine and really helped me lot"
The above reason should justify the objection and if you go through the chronology of the events, I have provided him solution many times.
Hilal
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.