Connect-SPOService: Current site is not a tenant administration site

In this post, I will show you the steps to fix the error Connect-SPOService: Current site is not a tenant administration site. I got this error when I tried to administer SharePoint Online sites using PowerShell. I installed the SharePoint Online Management Shell and ran the following command:

Connect-SPOService -Url https://mylab000.sharepoint.com/

This URL was one of my regular SharePoint Online sites. The command failed with below error:

Error
connect-sposervice : Current site is not a tenant administration site.
At line:1 char:1
connect-sposervice -url https://mylab000.sharepoint.com
~~~~~~~~~~~ CategoryInfo : NotSpecified: (:) [Connect-SPOService], ServerException
FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.Conne
ctSPOService
Current site is not a tenant administration site

The reason for this error is simple: Connect-SPOService can only connect to the SharePoint Online admin center, not to individual team sites or site collections.

What this error actually means

The Connect-SPOService cmdlet is designed to connect to the tenant administration site for SharePoint Online, for example:

https://<tenant-name>-admin.sharepoint.com

If you provide:

  • A regular team site URL like https://<tenant-name>.sharepoint.com/sites/ProjectA, or
  • A root site URL like https://<tenant-name>.sharepoint.com

Then SharePoint Online returns: Current site is not a tenant administration site.

Step 1: Get the Correct SharePoint Online Admin Center URL

If you are not sure what your admin URL is, you can grab it from the Microsoft 365 admin center.

  1. Sign in to https://admin.microsoft.com with an account that has admin rights.
  2. In the left navigation pane, expand Admin centers.
  3. Select SharePoint. This will open the SharePoint admin center in a new tab.
Sharepoint admin center from M365 portal

In the browser address bar, you will see the SharePoint Online admin URL, for example:

https://mylab000-admin.sharepoint.com

Copy this URL. This is the URL you must use with Connect-SPOService.

Copy Sharepoint Online admin URL

Step 2: Connect to SharePoint Online using the admin URL

Now open PowerShell or the SharePoint Online Management Shell and run the command below. For learning about multiple ways to connect to SharePoint Online, refer to the post Connect to SharePoint Online Using PowerShell [2-Ways].

Example

Connect-SPOService -Url https://mylab000-admin.sharepoint.com

You will be prompted to sign in. Use an account that is a SharePoint admin or global admin.

Connect-SPOService with sharepoint admin center URL

Alternatively, you can specify credentials explicitly:

$cred = Get-Credential
Connect-SPOService -Url https://mylab000-admin.sharepoint.com -Credential $cred

If the connection is successful, you will not see an error, and you can start running SharePoint Online PowerShell cmdlets such as:

Get-SPOSite
Get-SPOTenant
Set-SPOTenant

Step 3: Verify the connection

Run a simple command to confirm that you are connected to the SharePoint tenant admin center:

Get-SPOSite -Limit 5

If the command returns a list of sites, your connection is working correctly. You can now manage SharePoint Online via PowerShell from this session.

Read Next

Leave a Comment