Office 365 / SharePoint Online – Get-SPOSite : The site ‘SiteUrl’ is not properly formed.

Hi All,
Today new issue and solution 🙂
For my SharePoint online site, I need to set the one of the property through PowerShell. So I am trying to get the Site using Get-SPOSite as
PS C:\WINDOWS\system32> $site = Get-SPOSite "https://youcando.sharepoint.com/teams/youcandoteam/"
but I am getting following error as
Get-SPOSite : The site https://youcando.sharepoint.com/teams/youcandoteam/ is not properly formed.
At line:1 char:9
+ $site = Get-SPOSite “https://youcando.sharepoint.com/teams/youcandote …
+ CategoryInfo : NotSpecified: (:) [Get-SPOSite], ServerException
+ FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.GetSite

Fig 1 : Office 365 / SharePoint Online – Error “The site is not well formed”
After googling, in one of the blog found that use “Identity” element before the URL, so we tried as
$site = Get-SPOSite -Identity "https://youcando.sharepoint.com/teams/youcandoteam/"
but no luck 🙁
same error as – Get-SPOSite : The site ” is not properly formed as.

Fig 2 : Office 365 / SharePoint Online – Error “The site is not well formed” even though ‘-Identity’ parameter is used before
After googling bit more in one of the blog found that , remove the trailing “/” from the URL and it worked like charm 🙂 as
- Fig 3: Office 365 / SharePoint Online – after removing the trailing “/” Get-SPOSite worked
This is easiest solution but thought to share since it took my around an hour to solve this.
Thanks for reading 🙂
Keep reading, share your thoughts, experiences. Feel free to contact us to discuss more. If you have any suggestion / feedback / doubt, you are most welcome.
Stay tuned on Knowledge-Junction, will come up with more such articles / news
You must be logged in to post a comment.