# Change the SharePoint domain name in your Microsoft 365 Tenant

Back when all the Cloud and SaaS offerings where a brand new concept most IT administrators ended up choosing the domain name of a tenant. This choice would be then reflected in the SharePoint Online url and the only way to change it was to create brand new tenant. Either due to the somewhat poor choice from the IT administrators, due to mergers, rebranding or acquisitions some organization ended up with lets say less desirable domain name for their SharePoint URL.
Responding to clients with a “no it is not possible to change that” always bothered me back then. So when I learned that this option is now available (in preview) I immediately decided to try it. Via this post I want to share what I learned testing this option.

Please make sure to read the official documentation for limitations of this option and the fact that this is till in preview at the time of writing this post before even considering it in production.
Having said that, lets go!

1. Start by navigating to https://aka.ms/SPORenameAddDomain. Make sure to use this URL. If you decide to navigate without the use of this URL the rename will not work.
2. Click on Add a custom domain button at the top, then fill in the desired domain name including the .onmicrosoft.com suffix. As shown in the following image I want to rename my tenant from 2tkc6c to demojev there fore I used demojev.onmicrosoft.com.

NOTE 2: If you have to try and figure out if certain domains might be available you can just enter those domains in your browser using this format https://[YOUR_DOMAIN_NAME].sharepoint.com.

1. Click on the Add domain button at the bottom right corner. If the domain is available you will get a message Domain name added and will be redirected to screen show in the following image.

NOTE: Do not add any other domains and make sure you did not get a prompt create a new TXT record with your domain name registrar. Because if you did the domain name has not been added correctly and it will not be elegible for a rename. If you get this prompt you need to delete the newly added domain and recreate it again starting from step 1.

1. As show in the following image use the top navigation breadcrumb to go back to the custom domain names.

1. Ensure that the newly added domain name is verified. This is shown in the following image.

For continuing with the next steps the latest version of the SharePoint Online Management Shell is required. Make sure to have it installed.

1. Open a PowerShell 5.1 window and connect using the newly downloaded and installed SharePoint Management Shell by using the Connect-SPOService command using your current SharePoint domain. Depicted from my own rename in the following PowerShell snippet.
Connect-SPOService -Url "https://2tkc6c-admin.sharepoint.com"

1. A log-in prompt will be shown, use a Global Administrator account to complete this log-in. As again shown in the following image.

1. The last remaining step is to queue the rename. Since the rename must take place at least 24h in the future I decided to add a timespan of 24 hours and 10 minutes to the current date & time. The combined commands are shown in the following PowerShell snippet.

$now = Get-Date$timeSpan = New-TimeSpan -Hours 24 -Minutes 10
$scheduledDateTime =$now + $timeSpan Start-SPOTenantRename -DomainName "demojev" -ScheduledDateTime$scheduledDateTime


Example of the script outputs:

The command returns a RenameJobID but at this moment this ID cannot be used as input anywhere. The documentation states that the status of the rename can be acquired through the command Get-SPOTenantRenameStatus. However since it’s still in preview the following note is stated when navigating to the documentation:

This feature is in preview and currently available to organizations that have no more than 1,000 total SharePoint sites and OneDrive accounts combined.

Fast forward 24 hours and 10 minutes and the results of the rename should visible.

And that is it. Thanks for reading this post!