In this SharePoint tutorial, we will discuss how to fix error get-sposite the managed path is not a managed path in this tenant which comes while working with PowerShell.
The error also comes as get-sposite the managed path sites/ is not a managed path in this tenant.
get-sposite the managed path is not a managed path in this tenant
Recently, I was trying to remove SharePoint Online Site Collection Administrator using PowerShell by using the below script.
Connect-SPOService -url "https://tsinfo-admin.sharepoint.com/" -credential (Get-Credential)
$sitecollection = Get-SPOSite "https://tsinfo.sharepoint.com/sites/SPFxTraining/"
Set-SPOUser -site $sitecollection -LoginName "bhawana@tsinfo.onmicrosoft.com" -IsSiteCollectionAdmin $False
When I run the above script in PowerShell ISE, it gave the below error:
Get-SPOSite : The managed path sites/SPFxTraining is not a managed path in this tenant.
At line:2 char:19
- … ollection = Get-SPOSite “https://tsinfo.sharepoint.com/sites/SPFxTrai …
~~~~~~~~~~~~~- CategoryInfo : NotSpecified: (:) [Get-SPOSite], ServerException
- FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.GetSite
Set-SPOUser : Cannot bind argument to parameter ‘Site’ because it is null.
At line:3 char:19
- Set-SPOUser -site $sitecollection -LoginName “bhawana@tsinfo.onmicros …
~~~- CategoryInfo : InvalidData: (:) [Set-SPOUser], ParameterBindingValidationException
- FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.Online.SharePoint.PowerShell.SetSPOUser
The error looks like below:

The issue was coming because of the “/” in the site URL, so I removed the slash from the site URL and it worked fine for me.
Connect-SPOService -url "https://tsinfo-admin.sharepoint.com/" -credential (Get-Credential)
$sitecollection = Get-SPOSite "https://tsinfo.sharepoint.com/sites/SPFxTraining"
Set-SPOUser -site $sitecollection -LoginName "bhawana@tsinfo.onmicrosoft.com" -IsSiteCollectionAdmin $False
You may like following PowerShell tutorials:
- PnP PowerShell Commands for SharePoint Online List
- PnP PowerShell commands for SharePoint Online Site
- Get SharePoint document library size using PowerShell
- How to use PowerShell reference variable
- How to use PowerShell get-date cmdlets
- Retrieve all list names and list guids from SharePoint online site using PowerShell
- How to get all users from SharePoint site collection using PowerShell
In this tutorial, we learned how to fix error get-sposite the managed path sites/ is not a managed path in this tenant which comes while working with PowerShell.
I am Bijay a Microsoft MVP (8 times –Â My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com