Update Primary Email address using alias

Goal:

Use a powershell script that will take every user in the Active Directory and change their email address to [alias]@domain.com.

Background:

I was recently working on a migration for a company to move them from in house Exchange to Office 365 Exchange.  I used some powershell scripts to perform a few of the functions to change mailbox users to email enabled users.  In the process afterwards I somehow accidentally set all the email addresses to firstname.lastname@domain.com  The problem is that this isn't truly their email address.  There isn't a common pattern for all of the users, but luckily the alias didn't change.  So I'm hoping to pull that value to use in making things right.

It is Exchange 2010 if that makes a difference.  We have 2008 servers (and possible a 2008 r2 in the

July 23rd, 2015 6:42pm

Are you asking about Active Directory or about Office 365?

You can change the mai address in AD with set-aduser.   In Office 365 you can use Set-Mailbox to change the primary address.

Set-Mailbox user01 -PrimarySmtpAddress $newaddress

Free Windows Admin Tool Kit Click here and download it now
July 23rd, 2015 6:53pm

I'm wanting to make the change in their local Active Directory, which is not currently connected to Office 365 through any sync tools.
July 23rd, 2015 6:54pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics