top of page

Add UPN Suffix in Active Directory

Writer's picture: Anand PAnand P

Updated: Jul 8, 2022

What is User Principal Name (UPN)


User Principal Name (UPN) is a user identifier for logging in or a login name in Active Directory. A UPN consists of a UPN prefix (a user account name ) and a UPN Suffix (a DNS domain name) and these are joined using the '@' symbol.


For example, "anandp@anandpnair.com" in this 'anandp' is UPN prefix and "anandpnair.com" is UPN Suffix


Why do we need a UPN Suffix?

  1. The internal domain is techdc.local and if we want users to login with the "anandpnair.com" domain

  2. Implementing office 365 in the organization

  3. If the software requires the user UPN to match the email address for authentication

How to Add UPN in Active Directory GUI


Click Start and search for Active Directory Domain and Trusts, click on it



Right-click on Active Directory Domain and Trusts, and then choose Properties.


On the UPN Suffix tab, enter the UPN Suffix in Alternative UPN Suffixes, select ADD, for an example here I had added (anandpnair.com) as an alternative UPN suffix


Once it's added you can see the UPN suffix in the box click on Apply and OK to finish to add the alternative UPN Suffix successfully


How to select the alternative UPN suffix for a user account and update an existing one


While creating a new User Object in the user Logon name field select the alternative UPN suffix (anandpnair.com)

To update an existing one right-click on the user account and select properties, in the Account tab change the UPN suffix from "tchdc.local" to "anandpnair.com" and click on Apply and Ok to finish the changes




How to Add UPN in Active Directory Powershell

Note: Run Powershell in Administrative Privilege


To get the current list of Alternative UPN Suffix

Get-ADForest | Format-list UPNSuffixes

To add an Alternative UPN Suffix

Get-ADForest | Set-ADForest -UPNSuffixes    @{add="cloudtekspace.com"}

This will add the Alternative UPN suffix "cloudtekspace.com" validate using the Get-Adforest Command


Change UPN Suffix using Powershell


To get the current list of users with UPN suffix run the below command

Get-ADUser -Filter * | Sort-Object Name | Format-Table Name, USerPrincipalName

Two users Ajith k and Arjun VC is having UPN suffix as "techdc. local", to update the users to alternative UPN "anandpnair.com" from "techdc.local" run the below command

$LocalUsers= Get-ADUser -Filter "UserPrincipalName -Like '*techdc.local'" -Properties UserPrincipalName -ResultPageSize $null
$LocalUsers | foreach {$newUpn = $_.Userprincipalname.Replace("@techdc.local","@anandpnair.com"); $_| Set-ADUser -UserPrincipalName $newUpn}

Once it's completed the user's UPN is updated to "anandpnair.com"


To update users on specific OU you can use the below PowerShell command
Get-ADUser -Filter * -SearchBase "OU=Employees,DC=techdc,DC=local" | Sort-Object Name | Format-Table Name, USerPrincipalName

You can see the user Bruce C is having "techdc.local" as UPN suffix in this OU, use the below PowerShell command to update the UPN suffix for users in the OU

$LocalUsers= Get-ADUser -Filter {UserPrincipalName -Like '*techdc.local'} -SearchBase "OU=Employees,DC=techdc,DC=local" -Properties UserPrincipalName -ResultSetSize $null
$LocalUsers= Get-ADUser -Filter {UserPrincipalName -Like '*techdc.local'} -SearchBase "OU=Employees,DC=techdc,DC=local" -Properties UserPrincipalName -ResultSetSize $null

Once it's completed the user Bruce C UPN is updated to "anandpnair.com"




802 views0 comments

Recent Posts

See All
2023-02-01_17-26-41.jpg
About Me

Thank you for taking the time to visit my website. My name is Anand P, and I work as a Senior Engineer in IT. This blog is dedicated to providing articles on various Microsoft technologies such as Intune, Azure AD, Microsoft Defender for Endpoint, Azure, EMS, M365, Security, and more. Most of the content on this blog is based on the solutions and issues I encounter in my everyday work, and I use this platform as a technical notebook to keep track of my findings. Please note that any views expressed in my posts on this site are solely my own. Also, any code, scripts, demos, or examples provided in the blog posts are only for illustration. I hope you find my blog posts informative and useful.

Never Miss a Post. Subscribe Now!

Thanks for submitting!

  • LinkedIn
  • YouTube

Copyright © 2024 by Cloud Tek Space.

bottom of page