/errors/sharepoint-online/current-site-is-not-a-tenant-administration-site
Connect-SPOService : Current site is not a tenant administration site.
- tool
- SharePoint Online PowerShell
- versions
- Microsoft.Online.SharePoint.PowerShell 16.0.x
- os
- windows
Connect-SPOService : Current site is not a tenant administration site. means the URL you passed is a SharePoint site, not the SharePoint admin center. Connect-SPOService only connects to the admin center, whose host name is the tenant name followed by -admin:
Connect-SPOService -Url https://contoso-admin.sharepoint.com| URL | Works with Connect-SPOService |
|---|---|
| https://contoso-admin.sharepoint.com | Yes: admin center |
| https://contoso.sharepoint.com | No: root site |
| https://contoso.sharepoint.com/sites/finance | No: a site collection |
| https://contoso-my.sharepoint.com | No: OneDrive host |
Find the tenant name
The tenant name is the first part of the initial domain contoso.onmicrosoft.com, not your email domain. Open the SharePoint admin center in a browser from the Microsoft 365 admin center (Admin centers > SharePoint) and copy the host name from the address bar; it is the value for -Url.
Other sign-in requirements
Connect-SPOService signs in a SharePoint Administrator (or SharePoint Embedded Administrator). An account without that role cannot use the admin center even with the right URL.
| Sign-in | Command |
|---|---|
| Interactive (MFA) | Connect-SPOService -Url https://contoso-admin.sharepoint.com |
| Browser via MSAL | Connect-SPOService -Url https://contoso-admin.sharepoint.com -UseSystemBrowser $true |
| App-only with a certificate | Connect-SPOService -Url https://contoso-admin.sharepoint.com -ClientId APP_ID -TenantId TENANT_ID -CertificateThumbprint THUMBPRINT |
| Managed identity | Connect-SPOService -Url https://contoso-admin.sharepoint.com -ManagedIdentity |
| GCC High / DoD | add -Region ITAR |
After a successful connection, Get-SPOTenant returns the tenant settings; until then other SPO cmdlets fail with No connection available.