prashantgore
asked on
How to Create Bulk Distribution List in Exchange 2007
How to Create Bulk Distribution List in Exchange 2007 & also add multiple member.
ASKER
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
I have 1500 Distribution Group to be created in Exchange 2007 in one shot.
Can be like import from *.CSV file
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,Bo rn,Exp,Bir th 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
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,Bo
$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
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"}
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-distributiongroupmemb er $_.DG -member $_.member }
I again apologize for the overlook.
Hilal
Please use this script instead:
#Adds members to specific Distribution Group
$Member =Import-CSV "C:\Members.csv"
$Member | ForEach-Object -Process {Add-distributiongroupmemb
I again apologize for the overlook.
Hilal
ASKER
Dear Hilal1924
We are talking about Bulk DistributionGroup Creation.
I dont want to create Bulk mailboxes.
We are talking about Bulk DistributionGroup Creation.
I dont want to create Bulk mailboxes.
ASKER
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
}
ASKER
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
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
ASKER
Hi Hilal
you mean to say thisname , this_alias etc.
Are headings for csv file.
Bit confisued
you mean to say thisname , this_alias etc.
Are headings for csv file.
Bit confisued
You CSV File should have headings like this
Name Alias DisplayName Type
Hilal
Name Alias DisplayName Type
Hilal
Here it is listed better
Name,Alias,DisplayName,Typ e >> These are the headings
Chess,Chess,Chess Club,Security
Computer,Computer,Computer Club,Security
Name,Alias,DisplayName,Typ
Chess,Chess,Chess Club,Security
Computer,Computer,Computer
ASKER
Hi Upgrade to PowerShell v2. And you will not get this error. Also, Save the script as DistributionGroup.ps1 and then execute it.
Hilal
Hilal
ASKER
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
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
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
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
ASKER
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 ?
Eg:- DG Members
System Prashant
Now I need to add the owner of the group how to do that ?
"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
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
ASKER
Thanks but I need to add DG Owner in Bulk
Again does it have any command with csv file
Again does it have any command with csv file
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
Thanks for your help
Can you give me a scrip to create bulk Mail Enable Distribution Group.
Please mention the CSV heading format.
ASKER
can any body reply for above problem
ASKER
Hi Hilal
Thanks for the help provided but if you can give scrip for below mention problem. I would really appreciate you.
Thanks Again
Thanks for the help provided but if you can give scrip for below mention problem. I would really appreciate you.
Thanks Again
ASKER
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
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
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
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
"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
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
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