Modern SharePoint Online Programming - Chapter 8

Introduction 

 
Hi guys, here is a beautiful simple PS code to quickly rename the Modern Site collection.
 
#Renaming Modern Site Collection Name from Private to Team
#Using SPOService Connection
$Tenantadminurl = "https://<TenantName>-admin.sharepoint.com"
$cred = [System.Net.CredentialCache]::DefaultCredentials
[System.Net.WebRequest]::DefaultWebProxy.Credentials = $cred
Connect-SPOService -Url $Tenantadminurl
#Connect-PnPOnline -Url $url -useweblogin
$url="https://<TenantName>.sharepoint.com/sites/ExecutivePrivate"
$NewSiteUrl="https://<TenantName>.sharepoint.com/sites/ExecutiveTeam"
Start-SPOSiteRename-Identity $url -NewSiteUrl $NewSiteUrl
 
You can also do this manually by moving to the Tenant Modern Admin Centre>>Sites>> Active Sites>>Search for your Site>>Edit Title/Properties/Other properties such as Hub association, URL renaming, etc.
 
Happy Modern SharePoint Programming and Development :)