A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Follow https://learn.microsoft.com/en-us/sharepoint/change-your-sharepoint-domain-name
Step 1: How do I add the new domain name?
- Check the availability of the new domain you want. For example, if you want your SharePoint and OneDrive URLs to begin with
fabrikam.sharepoint.com, enterhttps://fabrikam.sharepoint.comin a browser. If you get a message that the address couldn’t be found (404), it's probably available. If you get a sign-in screen or a message that your username couldn’t be found in the fabrikam.sharepoint.com directory, then the domain is taken and you need to try a different one. If the domain is already registered by another customer, we can't provide any information or contact the customer.
-or-
If you own the domain for another subscription, you need to delete that tenant in Microsoft Entra ID. Deleting a tenant typically takes three days to complete and to make the domain available.
- Add your new .onmicrosoft.com domain using the Domains page in the M365 Admin Center.
- Don't use the "Add domain" option directly present in the Domains page, since that doesn't create a .onmicrosoft.com domain. Use the steps in the link above to correctly create one.
- Don't make this domain your fallback domain.
- Go back to the Domains page and check that the newly added .onmicrosoft.com domain appears in a 'Healthy' state.
Step 2: Use Microsoft PowerShell to rename your domain
- REQUIRED - Download the latest SharePoint Online Management Shell. If you installed a previous version of the SharePoint Online Management Shell, go to Add or remove programs and uninstall "SharePoint Online Management Shell". Make sure you review the System Requirements and Install Instructions. The app isn't supported on Mac.
- Connect to SharePoint as at least a SharePoint Administrator in Microsoft 365. To learn how, see Getting started with SharePoint Online Management Shell. Example:
Connect-SPOService -Url "https://contoso-admin.sharepoint.com" - Run the following command to specify the new domain name:
Where "DomainName" is the part before "sharepoint.com" or "onmicrosoft.com" and "ScheduledDateTime" is at least 24 hours in the future, but not more than 30 days. The time you enter is based on the current date and time of the computer you're using. Example:Start-SPOTenantRename -DomainName <DomainName> -ScheduledDateTime <YYYY-MM-DDTHH:MM:SS> [-WhatIf] [-Confirm]Start-SPOTenantRename -DomainName "fabrikam" -ScheduledDateTime "2021-12-31T10:25:00"If the PowerShell command Start-SPOTenantRename isn't found or nothing is returned, make sure you installed the latest SharePoint Online Management Shell. Before installing the latest version, you might need to uninstall all previous versions by runningUninstall-Module Microsoft.Online.SharePoint.PowerShell -Force -AllVersions. For more info about the Start-SPOTenantRename cmdlet, see Start-SPOTenantRename To cancel a rename before it starts, you can runStop-SPOTenantRename. More info about this cmdlet.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin