After renaming your Microsoft 365 tenant, Teams may stop enforcing the naming policy for new teams and channels. This happens because the naming policy references the old tenant ID or domain in its blocked words list and prefixes. You will see new teams created with default names instead of your custom prefix and suffix. This article explains the root cause and gives you step-by-step instructions to repair the policy so it applies again.
Key Takeaways: Restoring Teams Naming Policy After a Tenant Rename
- Teams admin center > Teams > Teams policies > Naming policy: Shows the current prefix, suffix, and blocked words that may still contain the old tenant name.
- PowerShell cmdlet Set-TeamsNamingPolicy: Lets you update the prefix, suffix, and blocked words list without recreating the policy.
- Teams admin center > Teams > Teams policies > Naming policy > Edit: Use this to verify the policy is enabled and assigned to the correct policy group.
Why the Naming Policy Stops Working After a Tenant Rename
When you rename a Microsoft 365 tenant, the underlying Azure AD tenant ID remains the same, but the primary domain and the onmicrosoft.com domain change. Teams stores the naming policy as a set of strings. If your prefix or suffix contained the old domain name, such as contoso.onmicrosoft.com, that string is now invalid. Teams still sees the policy as enabled, but it cannot match the new tenant context. As a result, new teams and channels are created without any enforced naming pattern.
Another reason is that the blocked words list may include the old tenant name or old domain. After the rename, these words no longer apply, but they also do not block anything new. The policy appears active, yet it has no effect because the relevant strings point to a domain that no longer exists.
How the Naming Policy Is Stored
The naming policy is stored as a JSON object that contains three properties: Prefix, Suffix, and CustomBlockedWordsList. Each property is a list of strings. Teams appends the prefix to the beginning of every new team name and the suffix to the end. If any of these strings contain the old tenant domain, the policy fails silently. The admin center shows the policy as enabled, but the strings are not applied.
What Changes During a Tenant Rename
A tenant rename updates the initial domain, the onmicrosoft.com domain, and the SharePoint admin URL. It does not change the tenant ID. Teams uses the tenant ID to locate the policy, so the policy object remains intact. The problem is purely the content of the prefix, suffix, and blocked words. You must update these strings to reflect the new domain.
Steps to Repair the Naming Policy After a Tenant Rename
Follow these steps to update the naming policy so it works with your new tenant name. You will need Teams admin permissions and the Teams PowerShell module.
- Connect to Teams PowerShell
Open Windows PowerShell as an administrator. RunInstall-Module MicrosoftTeams -Forceif the module is not installed. Then runConnect-MicrosoftTeamsand sign in with a Teams admin account. - Check the current naming policy
RunGet-TeamsNamingPolicyto see the current prefix, suffix, and blocked words. Look for any string that contains the old tenant domain, such as oldtenant.onmicrosoft.com. - Update the prefix with the new tenant name
RunSet-TeamsNamingPolicy -Prefix "NewPrefix-"where NewPrefix is your desired prefix. If your prefix contained the old domain, replace it with the new domain. For example, change “oldtenant-” to “newtenant-“. - Update the suffix with the new tenant name
RunSet-TeamsNamingPolicy -Suffix "-NewSuffix"to set the new suffix. Again, replace any old domain strings with the new ones. - Update the blocked words list
RunSet-TeamsNamingPolicy -CustomBlockedWordsList "word1","word2"to replace the entire blocked words list. Include the old tenant name and old domain as blocked words if you want to prevent their use. Also include any other words you previously blocked. - Verify the policy is enabled and assigned
Go to Teams admin center > Teams > Teams policies > Naming policy. Confirm the policy is set to Enabled. Under Policy groups, make sure the policy is assigned to the correct group. If not, select the group and click Edit, then choose the updated policy. - Test the policy by creating a new team
In Teams, create a new team. The name field should now show the prefix and suffix. Type a name and try to create the team. If the name contains a blocked word, you will see an error. This confirms the policy is active.
If the Policy Still Does Not Apply
If the policy still does not apply, check that you are not using the guest naming policy. The guest naming policy is separate and applies only to guests. Verify that the policy you updated is the one assigned to the team creators. Also, wait up to 24 hours for the change to propagate across all Teams clients.
If Teams Still Ignores the Naming Policy
Teams shows the default naming format instead of your prefix
This usually means the policy is not assigned to the user or group. Go to Teams admin center > Teams > Teams policies > Naming policy and check the Policy groups section. If the group is empty, click Add group and select the appropriate security group. Then assign the policy.
You get an error that the policy is not defined
This error appears when the policy object is corrupted or the tenant rename left a broken reference. Run Get-TeamsNamingPolicy to see if the policy exists. If it returns nothing, create a new policy with New-TeamsNamingPolicy and assign it.
Blocked words from the old tenant still appear in the list
After a tenant rename, the old domain is often no longer valid. You can keep the old domain in the blocked words list to prevent anyone from using it. However, you may want to remove it to avoid confusion. Use the Set-TeamsNamingPolicy command with the updated list.
Old Tenant Name vs New Tenant Name: Key Differences
| Item | Old Tenant Name | New Tenant Name |
|---|---|---|
| Primary domain | oldtenant.onmicrosoft.com | newtenant.onmicrosoft.com |
| Naming policy prefix | oldtenant- | newtenant- |
| Blocked words list | Contains oldtenant | Should contain newtenant |
| Teams behavior | Policy ignored after rename | Policy applies correctly |
After following these steps, your Teams naming policy will enforce the correct prefix, suffix, and blocked words again. Test it by creating a new team and verifying the name format. If you have multiple policy groups, update each one separately. Use the PowerShell command Get-TeamsNamingPolicy to confirm your changes before testing.