Avatar of teomcam
teomcam
 asked on

Adding bulk emails addresses in 2008 R2 Active Directory

One of my OU contains around 1000 users who don't have exchnage email accounts. Due to lack of hardware and bandwith we are using exchnage for only 1 OU's users which they are Staff.
We have another domain name and created email accounts on Google Mail.

My question is how can I add the new external emails into the users email field.
Note: I don't wanna use Google AD Sync
Please find the sample csv file that we have for all new users.


users.csv
Active DirectoryWindows Server 2008Powershell

Avatar of undefined
Last Comment
teomcam

8/22/2022 - Mon
Rajitha Chimmani

You may use the below lines of code to add additional email address to the existing Exchange mailbox.

Change the heading of second column to EmailAddress

foreach($user in import-csv users.csv){

$Emailaddresses = (Get-Mailbox -Identity $user.Samaaccountname).emailaddresses
$ExtAddr = "smtp:"+$User.EmailAddress
$Emailaddresses.Add($ExtAddr)
Set-Mailbox -Identity $user.Samaccountname -Emailaddresses $Emailaddresses
}

Note: Test this with a test mailbox first before proceeding with actual user mailboxes
Rajitha Chimmani

Alternate command

Import-CSV "users.csv" | ForEach {Set-Mailbox $_.samaccountname -EmailAddresses @{add=$_.Emailaddress}}


Ref: http://technet.microsoft.com/en-us/library/bb123794.aspx
SubSun

Are you trying to mail enable the users? or just want to add the email address in general tab of account? Also which version of exchange are you using?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
teomcam

ASKER
I Just wanna add the email address in General Tab of the account. I am using Exchange 2010 SP2
ASKER CERTIFIED SOLUTION
SubSun

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
teomcam

ASKER
I will try it asap and will get back to you.
Thanks
Rajitha Chimmani

Have you tried the one I gave you?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
teomcam

ASKER
No I don't think yours is a suitbale solution to my scenario. I just wanna add emails into the general tab of the people who don't have email address from our exchange server. I cannot accomodate any mailbox for that much users in the exchnage server.