A Guide to Change SharePoint Domain Name Using PowerShell
Are you an Office 365 admin, anxious about your old tenant, and want to change SharePoint domain name with the new one? Unfortunately, neither the SharePoint admin center nor any other Office 365 admin centers offer the flexibility to rename your SharePoint domain name in their portals.
However, Microsoft PowerShell has provided a simple way to change the SharePoint Online URL to a custom domain for an Office 365 tenant. Let’s delve into the below information and efficiently change your SharePoint domain name in your Microsoft 365 tenant using PowerShell.
What is the Necessity of SharePoint Domain Name Change?
Office 365 admins may decide to rename the SharePoint domain name to a new one for several reasons. A few of the main situations are listed below.
- To maintain a consistent domain name across all the company’s platforms and resources, administrators can choose to change the SharePoint Online site URL to their company name.
- Admins need to update the SharePoint domain name if their organization has undergone a merger or acquisition.
- Additionally, if they want to improve the Search Engine Optimization of their SharePoint sites, they need to rename the default domain name with the new custom domain.
Check for Custom Domain Name Availability for Your Office 365
To add a custom domain to your Office 365, you need to check for the availability of the custom domain name. This check is necessary for the complete renaming of the SharePoint domain.
Note: You need not have to check and add a custom domain name if you have already done this.
- If you want your URL to be ‘hello.sharepoint.com’ enter ‘https://hello.sharepoint.com/’ in your browser. If a 404 error (this site can’t be reached) is thrown, that means the URL is available.
- You can also check the availability of the new domain by logging into your current domain. If you receive a message stating that your username could not be found in the hello.sharepoint.com directory, this means that the domain has already been reserved. In this case, you have to try a different one.
- In addition to this, you can check the domain name availability via many online forums.
How to Add Custom Domain Name in Azure AD?
You have to add a new custom domain name in the Microsoft Entra admin center to rename the SharePoint site URL. The custom domain name added in your organization can only be used as a name for the new domain. Follow the below steps to add a custom domain name to your Office 365.
- Sign in to the Microsoft Entra admin center with the global administrator account.
- Then, Click the ‘Domain names‘ under the ‘Settings‘ tab.
- Select ‘Add custom domain‘. Then enter the full new “onmicrosoft.com” domain in the custom domain name box and select ‘Add domain‘.
Important: There is no need to purchase the “onmicrosoft.com” domain to add it and it does not require any public DNS registration.
- After the confirmation message that the “domain was added successfully”, you might see a message that the properties could not be found. Select the message to refresh the domain names.
- Ensure that the “onmicrosoft.com” domain you have added is present on the list and the status is verified. You can rename the SharePoint site only if the state is verified.
Change Your SharePoint Domain Name Using PowerShell
Office 365 admins use SharePoint Online Management Shell, a command-line utility, to interact with SharePoint sites without relying on a graphical user interface. You must install and connect to SharePoint Online PowerShell before renaming the SharePoint tenant name.
Below is the list of processes that can be executed while changing the domain name in SharePoint Online.
- Rename the SharePoint tenant’s name
- Get the status of SharePoint domain rename using PowerShell
- Retrieve the status of the site URL change in SharePoint Online
- Cancel SharePoint domain rename
Warning: Changing your SharePoint domain name may take several hours to days, depending on how many SharePoint sites and users you have. Also, activities related to regarding SharePoint and OneDrive will get blocked during the name change.
Rename the SharePoint Online Tenant’s Name
To schedule the SharePoint domain name change process, run the following command in PowerShell.
Start-SPOTenantRename -DomainName <DomainName> -ScheduledDateTime <YYYY-MM-DDTHH:MM:SS>
Where “DomainName” is the part before “sharepoint.com” or “onmicrosoft.com” and “ScheduledDateTime” is at least 24 hours in the future and must not be more than 30 days. The time you enter is determined by the actual date and time settings for the computer you are using.
Note: You will receive emails in the global administrator account when the task is scheduled, started, and completed. Also, changing the SharePoint domain name will also reflect on the URL of OneDrive.
Start-SPOTenantRename -DomainName "hello" -ScheduledDateTime "2023-03-28T15:45:00"
Get the Status of SharePoint Domain Rename Using PowerShell
After initiating the domain name change, you can check the status of the domain name change. Run the following cmdlet in PowerShell to get the detailed status of the SPO site URL rename.
Retrieve the Status of Site URL Change in SharePoint Online
You can get the current status of the SharePoint tenant URL rename for specific sites if necessary. Execute the below cmdlet with the required parameters such as the State, Identity and ParentOperationId.
The below cmdlet will return the domain rename state of the specific SharePoint site.
Get-SPOSiteRenameState -Identity https://contoso.sharepoint.com/sites/ContosoPage
Also, you can execute the below to get the status for all the SharePoint sites in your Office 365 tenant.
$tenantRenameJobId = (Get-SPOTenantRenameStatus).RenameJobId Get-SPOSiteRenameState -ParentOperationId $tenantRenameJobId
Cancel SharePoint Domain Rename
Admins can revoke or stop the SharePoint site rename process if they decide to have their old domain name in Office 365. The scheduled process cannot be stopped if the work is already in progress. Thus, you can execute the following cmdlet to change your SharePoint domain name.
Stop-SPOTenantRename -Reason <SpecificReason>
Specify the reason for cancelling the SharePoint domain name change process as a parameter.
Stop-SPOTenantRename -Reason "Restart the SharePoint domain URL changing process"
Limitations in Changing the SharePoint Domain Name
You must be aware of the limitations of changing SharePoint and OneDrive domain name. The following is the list of restrictions you must keep in mind when performing a SharePoint tenant rename.
- Site Count Limitations: Organizations having more than 10,000 total SharePoint sites and OneDrive accounts combined cannot be renamed.
- Special Clouds Usage Restrictions: Your domain name can’t be changed if your organization uses special clouds or government clouds such as GCC, GCC High, DoD, etc.
- Expiry of Redirection: A redirect to the previous address will expire after one year by the renaming of your SharePoint domain.
- Need of Support Request for Another Rename: If you need additional tenant rename, you must submit a support request by selecting rename a SharePoint tenant more than once.
- Restriction with Multi-geo Setup: Organizations with a multi-geo setup do not support the domain name change.
- Unable to Back to Original Name: Changing your SharePoint domain name back to the original name after renaming is impossible. For example, if you change your SharePoint domain from contoso.sharepoint.com to hello.sharepoint.com, changing it back to contoso.sharepoint.com is not at all possible.
Impacts of Changing SharePoint Domain Name in Office 365
In addition to the limitations, you will get low-level to high-level impacts, as listed below, when you try to change SharePoint domain name in Microsoft 365.
Below are a few significant impacts that can occur after the SharePoint tenant rename. However, many of the impacts can be rectified with the appropriate actions.
- Sync error with office 365 products.
- The Quick access links in OneDrive and SharePoint won’t work.
- Power BI reports using SharePoint connections as a data source won’t work.
- Add-ins might not function as expected.
- Any sites that have been deleted can’t be restored after the domain name change.
- Restoring a site to a previous time before the domain name change isn’t possible, etc.
The full impact of the SharePoint domain name change is not known until the execution of the domain rename.
Overall, changing the domain name in SharePoint is a detailed process that requires careful planning and execution. However, by following the above guidelines mentioned in this blog, you can efficiently change the SharePoint domain name in your Office 365 tenant. I hope this blog will help every office 365 admin who wants to perform a SharePoint domain name change. Feel free to reach us in the comments for any assistance.
“Understand the need for changing the SharePoint domain and adhere to the PowerShell instructions”