Bulk UPN Changes in AD for Office 365

What does it mean and what do you need this changes?

Again it would be better that we start with an example for this subject.

Your company has internal domain such as xyz.local and all user are using it when they login to computer. On the other hand, your company has an email domain that is official for external such as xyzholding.com and user email is like this, john@xyzholding.com

This is where the problem is starting when you want to move your email system to Office 365. Let’s go deeper little bit. You might aware of that you will use Dirsync to migrate internal users to Office 365 and Dirsync matches UPN suffix in your AD and user’s UPN suffix in Office 365.

Therefore, You need to change the UPN in AD. I have mentioned this before (https://moonstarit.wordpress.com/2014/07/23/office-365-active-directory-preparation-part-4/).

This time we are going to stick that article, and add the UPN suffix to Domain and Trusts. What if we need to change 500 users UPN suffix? Are we going to adjust each user’ suffix manually? If you have time, yes, you can. Otherwise open your PowerShell

Get-ADUser -Filter * -SearchBase ‘ou=test,dc=yaylali,dc=local’ -Properties userPrincipalName | foreach { Set-ADUser $_ -UserPrincipalName (“{0}@{1}” -f $_.name,”sonatyaylali.com”)}

I have tested it in my Test Organization Unit named test. My internal domain is yaylali.local and primary email address is @sonatyaylali.com that is also added to Domain and Trusts.

You can edit the script according to your names.


Stay tuned!

Sonat Yaylali


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: