Script to update users’ UPN to their email address

When using AAD Connect with Office 365 the general accepted best practice is to use a publicly routable UserPrincipalName attribute in your on-premises Active Directory rather than using AlternateLoginID.

PowerShell logo

I run across the this at lots of customers and have written a script that can be used at any customer to reset UPNs for all users in an OU to their email address attribute. This script can easily be amended to use group membership or another attribute to select users to update.

The script is available for download on the Technet Gallery here.

If you have any questions, suggestions, corrections, criticisms or other feedback please let me know in the comments section below, via twitter @MikeParker365 or via email

Leave a Reply

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

You are commenting using your 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