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
Avatar of Rajitha Chimmani
Rajitha Chimmani
Flag of United States of America image

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
Alternate command

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


Ref: http://technet.microsoft.com/en-us/library/bb123794.aspx
Avatar of SubSun
SubSun
Flag of India image

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?
Avatar of teomcam
teomcam

ASKER

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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of teomcam
teomcam

ASKER

I will try it asap and will get back to you.
Thanks
Have you tried the one I gave you?
Avatar of teomcam
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.
Windows Server 2008
Windows Server 2008

Windows Server 2008 and Windows Server 2008 R2, based on the Microsoft Vista codebase, is the last 32-bit server operating system released by Microsoft. It has a number of versions, including including Foundation, Standard, Enterprise, Datacenter, Web, HPC Server, Itanium and Storage; new features included server core installation and Hyper-V.

86K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo