Change SharePoint site URL using a PowerShell Script | Infrassist

Powershell Script

Infrassist Technologies Pvt Ltd
4 min readMay 20, 2022

So here’s the scenario.

One of our UK Based MSP partners had signed up with an end customer who had an M365 tenant with a name that wasn’t needed anymore.

We’ll get it straight…

Let’s assume 4 partners together opened up a firm and the domain name was with the initial of all these four people. Out of the four, 2 have withdrawn their stake from the company and so they are now left with a domain name that has the initials of them all. It doesn’t make sense right?

They did change the name of their organization, but a domain name is something that can’t be changed just like that. Especially when a lot of users are already present in the tenant.

They kept on adding users and services in that tenant, and it just made it more difficult to change the domain name. And because of that, it was not possible to delete that tenant and create a new one too.

We got a request from our MSP Client where we were asked if could specifically change the initial domain name for the SharePoint sites.

This scenario could be common for many since companies do undergo rebranding, mergers, acquisitions or a split.

The only point to be noted here is that we can perform this domain change procedure for SharePoint and OneDrive URLs only.

Ensure that the URL is not taken. Make sure it is available.

P.N. As we are white-labelled service providers, we cannot disclose the names of our MSP Clients or their end customers unless they have given us permission to do so. Hence the names we have used for this blog are only for example purposes. These are not real names.

First Step to change Sharepoint site URL:

In our first attempt to rename the added initial domain, we realized that it was not possible to change or modify it as M365 didn’t permit that.

Here’s a step-by-step procedure of how we went ahead with the same.

WARNING: Make sure you’ve carefully read about the SPO Tenant rename and understand its impact on your organization https://aka.ms/SPOTenantRename.

Here’s how we changed the domain name on SharePoint and OneDrive:

Goal: To add the domain name suggested by the end-user

Let’s assume that the end customer name is “LANJABIL”, consisting of the initials of all 4 founders of the organization. The first two founders (L.A. and N.J.) have left, and now we are left with (A.B. and I.L.).

“LANJABILLimited-admin.sharepoint.com”

  • Connect-SPOService -Url https://lanjabillimited-admin.sharepoint.com
  • Then we require to run the command which will make changes to the default URL and it will change it to the new requested URL
  • After that, it will take 24 hours to propagate the changes to all SharePoint sites.
  • I have added a screenshot for the Reference

Points to remember: -

  • This change affects only SharePoint and OneDrive URLs. It doesn’t mean that the name would change in email addresses.
  • If you have set up multi-geo, this feature cannot be enabled for your organization
  • You can only rename your SharePoint domain once every six months
  • Once you change your SharePoint domain you cannot go back to the original name
  • If you have deleted any of the SharePoint sites, it cannot be restored after the change. So before you make the change, ensure to check the sites that you have deleted and if you want to restore any of those.
  • Check if Before changing your domain name, review any sites and OneDrive accounts that have been locked to determine if the lock should be removed

Weekly Tech Blogs

We upload blogs on our website every week. So keep an eye on these if you want to get solutions to you tech problems.

Originally published at https://www.infrassist.com.

--

--