Forum Discussion

daivea's avatar
daivea
Copper Contributor
Jun 27, 2024

SPO Site rename

Hi all,

 

I am looking for a way to rename a SharePoint site but only the site name (I don't want the URL changed). I have found scripts to rename the site title but not the actual name.

 

I have tried scripts to rename the connected M365 group, but that only updates the site name under basic info, but does not update the name under site info.

 

Interestingly if i update the name of thew group manually in the admin center, it updates correctly in SPO (but doesn't update the name under basic info).

 

These are the properties I am looking to update

 

 

I am needing to prefix over a thousand sites so I really need to find a way to do this in PowerShell or even Graph API.

  • daivea 

    Powershell:

     

    $url="https://<tenant>.sharepoint.com/sites/samplesite"
    $newTitle="New Title"
    Start-SPOSiteRename -Identity $url -NewSiteTitle $newTitle
    

     

     

    PnP:

     

    $SiteURL = "https://contoso.sharepoint.com/coolsite"
      
    #Connect to PnP Online
    Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)
     
    #sharepoint online powershell change site name
    Set-PnPWeb -Title "Coller Site Portal"

     

     

    • daivea82's avatar
      daivea82
      Copper Contributor
      Thanks, but I don't want the URL changed. Is there no way to do this without changing the URL?
      • daivea82's avatar
        daivea82
        Copper Contributor
        If I use your second example, all that does is change the title within the site. I am looking to change the name of the site in the admin center

Resources