Add a UPN suffix in Active Directory Domains and Trusts under Properties > UPN Suffixes, then pick that suffix for each user on the Account tab in Active Directory Users and Computers, or set it in bulk with Set-ADUser.
This guide covers what the userPrincipalName attribute holds, the PowerShell commands for suffixes and users, how UPNs sync to Microsoft Entra ID, and what to watch for before you change them.
How to add alternative UPN suffix in Active Directory?
An alternative suffix lets users sign in as [email protected] even when the AD domain is contoso.local or corp.contoso.com. The suffix is stored once for the whole forest.
- On a domain controller, open Server Manager and select Tools > Active Directory Domains and Trusts. You can also press Win + R, type
domain.mscand select OK. - In the console tree, right-click Active Directory Domains and Trusts at the top and select Properties.
- Open the UPN Suffixes tab.
- In the Alternative UPN suffixes box, type the new suffix, such as
contoso.com. - Select Add, then Apply.
- Repeat for any other suffixes and select OK.
The suffix now appears in the UPN suffix list for every user in the forest. Nothing changes for existing accounts until you assign the suffix to them.

What is userPrincipalName in Active Directory?
The userPrincipalName attribute is the user's logon name. It is an Internet-style name based on RFC 822, and by convention it should match the user's email address.
| Point | What it means |
|---|---|
| Format | A UPN prefix (the account name), the @ sign, and a UPN suffix (a DNS domain name), for example [email protected]. |
| Uniqueness | A UPN must be unique among all security principals in the forest. The same prefix can be reused with a different suffix. |
| Allowed suffixes | The DNS name of any domain in the forest, or an alternative name listed in the upnSuffixes attribute of the Partitions container. It does not have to be the user's own domain. |
| Default suffix | The DNS name of the domain where you created the account, so a user made in contoso.com gets [email protected]. |
| Renames and moves | The UPN is unaffected when the user object is renamed or moved, so the sign-in name survives a restructure. |
| Attribute type | An indexed, single-valued string. It can be left empty when the account is created. |
| sAMAccountName | The older pre-Windows 2000 logon name, limited to 20 characters and unique within the domain, not the forest. |
At sign-in, a domain controller looks for the UPN in the local domain and then in the global catalog. If the global catalog does not hold it, the sign-in fails.
Add a UPN suffix with PowerShell Set-ADForest
The same change runs from PowerShell with the ActiveDirectory module. -UPNSuffixes edits the forest's msDS-UPNSuffixes property on the cross-reference container.
Set-ADForest -Identity contoso.local -UPNSuffixes @{Add="contoso.com","labs.contoso.com"}
Adds two alternative suffixes to the contoso.local forest without touching any that already exist. Use @{Replace=...} to overwrite the whole list instead.
You should see: The command returns no output. (Get-ADForest).UPNSuffixes now lists the new suffixes.
Run it from a session with rights to change the forest configuration. You can also pipe the current forest in: Get-ADForest | Set-ADForest -UPNSuffixes @{Add="contoso.com"}.
Changing the user principal name (UPN) in Active Directory
Active Directory Users and Computers changes one account at a time. It is part of the Remote Server Administration Tools, so you can also install Active Directory Users and Computers on a Windows 10 or 11 admin PC.
- Open Server Manager and select Tools > Active Directory Users and Computers, or press Win + R, type
dsa.mscand select OK. - Find the user, right-click the account and select Properties.
- Open the Account tab.
- Edit the logon name prefix in the first box if the name part should change.
- In the UPN suffix drop-down list next to it, select the new suffix.
- Select OK to save the change.
The drop-down only lists forest domains and the alternative suffixes added earlier. If the suffix you want is missing, add it first in Active Directory Domains and Trusts.

Change a user's UPN with PowerShell Set-ADUser
Set-ADUser -Identity bsimon -UserPrincipalName "[email protected]"
Sets the userPrincipalName of the account bsimon. The value takes the form user@DNS-domain-name, and the suffix must already exist in the forest.
You should see: No output. Get-ADUser bsimon | Select-Object UserPrincipalName shows the new value.
Because the UPN is independent of the distinguished name, the account can be moved or renamed later without changing its sign-in name.
Bulk change UPN suffix for all users with PowerShell
When many accounts use an old suffix such as contoso.local, change them in one pass. Test it on a small set of users before the whole domain.
$LocalUsers = Get-ADUser -Filter "UserPrincipalName -like '*contoso.local'" -Properties userPrincipalName -ResultSetSize $null
$LocalUsers | foreach {$newUpn = $_.UserPrincipalName.Replace("@contoso.local","@contoso.com"); $_ | Set-ADUser -UserPrincipalName $newUpn}
Finds every user whose UPN ends in contoso.local, with no limit on result size, and replaces the suffix with contoso.com while keeping each prefix. Change both domain names to match your own.
You should see: Running the first line again returns no users.
To try it on one OU first, add -SearchBase "OU=Pilot,DC=contoso,DC=local" to the Get-ADUser query on the first line.
List UPN suffixes and user UPNs in Active Directory with PowerShell
Get-ADForest | Select-Object -ExpandProperty UPNSuffixes
Get-ADUser -Filter * -Properties userPrincipalName | Select-Object Name, UserPrincipalName
The first line prints every alternative UPN suffix in the forest. The second lists each user's name beside its current UPN.
You should see: Your new suffix appears in the first list, and the changed accounts show it in the second.
An empty first result means the forest has no alternative suffixes, only the domain names themselves.
UPN suffix and Microsoft 365 sync with Entra Connect
Microsoft Entra Connect copies the on-premises userPrincipalName into Microsoft Entra ID, where it becomes the user's sign-in name. What arrives depends on whether the suffix is a verified domain in the tenant.
| On-premises UPN | UPN in Microsoft Entra ID |
|---|---|
| Suffix matches a verified domain ([email protected]) | The same value, [email protected]. |
| Non-routable suffix ([email protected]) | Replaced with the initial domain, for example [email protected]. |
| Suffix not verified in the tenant | Rebuilt as MailNickName@initial domain, using the first of mailNickName, primary SMTP prefix, mail prefix, UPN prefix. |
| Contains a space, line break or other invalid character | Treated as invalid and recalculated the same way as a non-verified suffix. |
The fix for a .local forest is to add a routable UPN suffix that matches a verified Microsoft 365 domain and move users onto it before syncing. Microsoft describes changing the primary domain instead as an involved process.

What happens when you change a user's UPN
Sign-in pages often treat the UPN as an email address, so Microsoft recommends changing the UPN when the primary email changes. A change can still break things that store the old name.
| Affected | What can happen | Workaround |
|---|---|---|
| SaaS and line-of-business apps | Apps that use just-in-time provisioning can create a second profile for the new UPN. | Use automated app provisioning, or have the app admin relink the profile. |
| Microsoft Entra joined devices | Single sign-on problems after the change. | Wait for the change to sync, then sign in with Other user. |
| Windows 10 hybrid joined devices | Signing in before the new UPN syncs can cause SSO failures and a forced restart. Fixed in the Windows 10 May 2020 update. | Run dsregcmd /leave, restart, then sign in with Other user. |
| Windows Hello for Business | Users must enroll again after the device rejoins. | Plan re-enrollment with the change. |
| Your own scripts | Anything keyed on the UPN stops matching. | Key scripts on objectGUID, which never changes. |
Roll out bulk changes to a small pilot group first and keep a tested way to put the old UPNs back.

Remove a UPN suffix from Active Directory
- Run
Get-ADUser -Filter "UserPrincipalName -like '*@labs.contoso.com'"to find accounts still using the suffix. - Move those accounts to another suffix with
Set-ADUser -UserPrincipalName. - Run
Set-ADForest -Identity contoso.local -UPNSuffixes @{Remove="labs.contoso.com"}. - Run
(Get-ADForest).UPNSuffixesand check that the suffix is gone from the list.
A UPN suffix must be a forest domain or a listed alternative, so move accounts off it before you remove it. Set-ADForest -UPNSuffixes $Null clears every alternative suffix at once; avoid it unless that is the intent.
UPN suffix not working in Active Directory
Synced users show an onmicrosoft.com UPN in Microsoft 365
The on-premises suffix is .local or is not a verified domain in the tenant.
- Add and verify the custom domain in Microsoft Entra ID.
- Add the same domain as an alternative UPN suffix in Active Directory Domains and Trusts.
- Change the users' UPNs to that suffix and let Entra Connect sync the update.
The new suffix does not appear in the user's Account tab
The suffix was never added at forest level, or was typed into the wrong forest.
- Run
(Get-ADForest).UPNSuffixesand look for the suffix. - Add it with
Set-ADForest -UPNSuffixes @{Add="contoso.com"}if it is missing. - Close and reopen Active Directory Users and Computers, then open the user's Account tab again.
User cannot sign in with the new UPN
The domain controller could not find the UPN in the global catalog, or a device still holds the old name.
- Check the change with
Get-ADUser <user> -Properties userPrincipalName. - Allow time for replication to reach the global catalog.
- On the sign-in screen, select Other user and enter the new UPN.
Entra ID UPN does not update after the change
Entra ID only recalculates the UPN when an on-premises UPN change syncs, and an unverified suffix is still replaced.
- Confirm the suffix is a verified domain in the tenant.
- Wait for the next Entra Connect sync cycle.
- Check the result in the Microsoft Entra admin center or with
Get-MgUserin Microsoft Graph PowerShell.

Active Directory UPN suffix FAQ
What is a UPN suffix in Active Directory?
A UPN suffix is the part of the user principal name after the @ sign, such as contoso.com in [email protected]. It must be the DNS name of a forest domain or an alternative suffix added in Active Directory Domains and Trusts.
What is the difference between UPN and sAMAccountName?
The UPN is an Internet-style name such as [email protected] that must be unique across the forest. The sAMAccountName is the older pre-Windows 2000 logon name, up to 20 characters and unique only within its domain.
Does a UPN suffix need to be a real domain?
In Active Directory it only needs to be a DNS-style name added to the forest. For Microsoft 365 and Entra ID sign-in, the suffix must match a domain you have verified in the tenant, or sync replaces it with onmicrosoft.com.
Can the UPN be different from the email address?
Yes, but Microsoft recommends keeping them identical. Sign-in pages often ask for an email address, so a mismatch confuses users. Entra ID also offers alternate login ID, which lets users sign in with the mail attribute instead.
Does changing a UPN change the user's SID or GUID?
No. The objectSid and objectGUID stay the same, so group memberships and permissions are kept. Only the sign-in name changes, but apps that store the UPN may treat the user as new.
Where are UPN suffixes stored in Active Directory?
They are stored in the upnSuffixes attribute of the Partitions container inside the Configuration container. Set-ADForest -UPNSuffixes edits this list, and Get-ADForest shows it in the UPNSuffixes property.


![How to create a list in Microsoft SharePoint [5 tested ways]](https://techdows.com/wp-content/uploads/2026/12/How-to-create-a-list-in-Microsoft-SharePoint-5-tested-ways-1-600x338.jpg)

