Share via

Getting an error using Connect-SPOService

Anonymous
2024-04-08T20:18:06+00:00

I am a Sharepoint Global Admin. I am trying to use PowerShell to get a list of all my SharePoint sites, with Admins and members. However, when I try to run any of the Get-SPOxxx commands, I get various errors. One is: Get-SPOSite : Attempted to perform an unauthorized operation. Another is: Get-SPOSite : Attempted to perform an unauthorized operation. I am so unbelievably frustrated I can"t see straight. The one command I can get to work, which returns absolutely useless information, is Get-SPOSiteGroup. This is what I get:

LoginName : Excel Services Viewers

Title : Excel Services Viewers

OwnerLoginName : SHAREPOINT\system

OwnerTitle : System Account

Users : {}

Roles : {View Only}

LoginName : SharePointHome OrgLinks Admins

Title : SharePointHome OrgLinks Admins

OwnerLoginName : SharePointHome OrgLinks Admins

OwnerTitle : SharePointHome OrgLinks Admins

Users : {96d7c141-**********************12427-50e6-4ef2-a872-a72464dde1f0}

Roles : {Limited Access}

LoginName : SharePointHome OrgLinks Editors

Title : SharePointHome OrgLinks Editors

OwnerLoginName : SharePointHome OrgLinks Editors

OwnerTitle : SharePointHome OrgLinks Editors

Users : {96d7c141-*******************dcb00008, 0c412427-50e6-4ef2-a872-a72464dde1f0}

Roles : {Limited Access}

LoginName : SharePointHome OrgLinks Viewers

Title : SharePointHome OrgLinks Viewers

OwnerLoginName : SharePointHome OrgLinks Admins

OwnerTitle : SharePointHome OrgLinks Admins

Users : {spo-grid-all-users/173cd593-*******************-9fd400fd262c}

Roles : {Limited Access}

LoginName : Team Site Members

Title : Team Site Members

OwnerLoginName : Team Site Owners

OwnerTitle : Team Site Owners

Users : {******@mydomain.com, ******@mydomain.com, ******@mydomain.com}

Roles : {Edit}

LoginName : Team Site Owners

Title : Team Site Owners

OwnerLoginName : Team Site Owners

OwnerTitle : Team Site Owners

Users : {SHAREPOINT\system}

Roles : {Full Control, Limited Access}

LoginName : Team Site Visitors

Title : Team Site Visitors

OwnerLoginName : Team Site Owners

OwnerTitle : Team Site Owners

Users : {}

Roles : {Read}

I connect with Connect-SPOService, login as global admin just fine, but none of the commands work. I've tried changing the URL: from mydomain.sharepoint.com to mydomain.sharepoint.com/sites, and /sites/ but no luck.

Any help would be greatly appreciated

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-04-09T13:19:49+00:00

    Mia,

    Thank-you very much for the quick reply and the advice. I appreciate you pointing me in the right direction.

    Have a good day!

    Michael

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-04-09T01:12:31+00:00

    Dear respected Michael,

    Good day!! Welcome to Microsoft Community

    I understand your concern that it shows errors to prevent you from running commands with PowerShell to get SharePoint sites list. We would like to help but we are sorry to convey that moderators here mainly focus on out-of-box features in SharePoint Online environment and we have limited support experience on PowerShell.

    To make sure you can get the professional guide on resolving the error, I suggest you post your concern in the related community Microsoft PowerShell Community to get the detailed technique support from the PowerShell experts.

    Here is few threads I found in that community with similar error message when using other commands, and I hope they can give the reference to post your own thread:

    Set-ACL "Attempted to Perform an Unauthorized Operation" - Microsoft Community Hub

    Add-PnPTenantTheme - Attempted to perform an unauthorized operation. - Microsoft Community Hub

    Apologies for redirecting you to a different community but we hope you can get the fast and better assistance of PowerShell commands, we have redirected you to the correct community.

    In addition, I will keep this thread open so that other SharePoint MVPs in our community may share their ideas and other possible troubleshooting suggestions on your requirement.

    Appreciate your patience and understanding. Have a great day!!

    Best Regards,

    Mia

    Was this answer helpful?

    0 comments No comments