Forum Discussion

tcboeira's avatar
tcboeira
Brass Contributor
Oct 23, 2023

How to change Sharepoint Online site name using Powershell

Is there a way to change Sharepoint Online site name using Powershell?

 

Start-SPOSiteRename it's not useful for this.

  • Ah! I understand 🙂

    So use the PnP one instead, that doesn't require a NewUrl field. So you can change just the title 🙂
  • tcboeira 

    Why didn't  Start-SPOSiteRename work for you ?

     

     

    SPO:

     

    #Set Parameters
    $AdminCenterURL="https://Contoso-admin.sharepoint.com"
    $SiteURL = "https://Contoso.sharepoint.com/sites/HR"
    $NewSiteURL = "https://Contoso.sharepoint.com/sites/HRInteral"
    $NewSiteTitle = "HR Interal"
     
    #Connect to SharePoint Online
    Connect-SPOService -Url $AdminCenterURL
     
    Start-SPOSiteRename -Identity $SiteURL -NewSiteUrl $NewSiteURL -NewSiteTitle $NewSiteTitle -Confirm:$false

     

    PNP:

     

    #Parameters
    $AdminSiteURL="https://Contoso-admin.sharepoint.com"
    $OldSiteURL = "https://Contoso.sharepoint.com/sites/HR"
    $NewSiteUrl = "https://Contoso.sharepoint.com/sites/HRInternal"
     
    #Connect to SharePoint Online from PnP PowerShell
    Connect-PnPOnline -Url $AdminSiteURL -Interactive
     
    #Change sharepoint online site url powershell
    Rename-PnPTenantSite -Identity $OldSiteURL -NewSiteUrl $NewSiteUrl

     

     

     

    • tcboeira's avatar
      tcboeira
      Brass Contributor
      Hi NicolasKheirallah,
      Thank you very much for your feedback...

      Just one adjustment: I don't speak English and I use an online translator. It may be that I make a mistake when expressing myself, but I'll try my best 😉

      Good...

      In this case "SPO" works. I even redid it to make sure...
      In this case it works IF I even change the website URL.
      What I would like to do is not change the URL.

      Just the Title. I can't do this.
      • Ah! I understand 🙂

        So use the PnP one instead, that doesn't require a NewUrl field. So you can change just the title 🙂

Resources