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 

but I am getting following error as

Get-SPOSite : The site is not properly formed.
At line:1 char:9
+ $site = Get-SPOSite “

+ 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 ""

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

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: