Answered by:
Secondary SMTP address from CSV file

Question
-
I've recendly added a new domain to my exchange 2007 server and only want a hanful of users to have the new domain addresses. I'm looking for a script that I can take an Excel CSV input file with their alias and add the new domain address as firstname.lastname@newdomain.com. Anybody have a quick script tucked away somewhere for that? I know this can be done via EAP and all...but I'm looking to do things in a specific way.
Steve CarnesTuesday, December 27, 2011 6:16 PM
Answers
-
I can take an Excel CSV input file with their alias and add the new domain address as firstname.lastname@newdomain.com.
Hi Steve,
Any updates?
Please test the following cmdlets:
csv file format(c:\addess.csv):
alias,address2
a.a,a.a@newdomain.com
b.b,b.b@newdomain.com
....
EMS:
import-csv c:\address.csv | foreach {
$temp = get-mailbox -identity $_.alias
$temp.emailaddresses.add($_.address2)
$temp | set-mailbox
}
Frank Wang
TechNet Community Support
- Marked as answer by emma.yoyo Tuesday, January 3, 2012 1:29 AM
Thursday, December 29, 2011 8:42 AM
All replies
-
Are the users all in the same OU or parent OU? You could set an address policy and filter by OU if so. If this will not work I will try to figure out a script.
-DrewTuesday, December 27, 2011 7:07 PM -
They are all scattered throughout multiple OU's unfortunately.
Steve CarnesTuesday, December 27, 2011 7:14 PM -
Can you filter based on any of the following:
-Company, department or Exchange Custom Attribute
It would be simple to add a value to one of the custom attributes from a CSV list of mailboxes, then add the secondary addresses through policy.
This should help with your original request though:
http://exchangepedia.com/2007/03/how-to-add-additional-email-addresses-to-a-recipient.html
-DrewTuesday, December 27, 2011 7:24 PM -
I can take an Excel CSV input file with their alias and add the new domain address as firstname.lastname@newdomain.com.
Hi Steve,
Any updates?
Please test the following cmdlets:
csv file format(c:\addess.csv):
alias,address2
a.a,a.a@newdomain.com
b.b,b.b@newdomain.com
....
EMS:
import-csv c:\address.csv | foreach {
$temp = get-mailbox -identity $_.alias
$temp.emailaddresses.add($_.address2)
$temp | set-mailbox
}
Frank Wang
TechNet Community Support
- Marked as answer by emma.yoyo Tuesday, January 3, 2012 1:29 AM
Thursday, December 29, 2011 8:42 AM