SharePoint Online Get-SPOUser IsSiteAdm Error 429

Terry N 116 Reputation points

Is there another way to find Site Administrators in SharePoint Online?

I have tried the following but on some sites I get an error 429.

Get-SPOUser -Site $SiteUrl -Limit All | select DisplayName,LoginName,IsSiteAdmin,IsGroup,@{n="Groups";e={$_.Groups -join ";"}}  | Export-Csv -nti "blabla.csv"

Most of the sites it fails on seem to use the "Everyone except external users" group and this would be in excess of 5000 users which I believe to be the problem.

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,041 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,626 questions
No comments
{count} votes

Accepted answer
  1. Terry N 116 Reputation points

    Okay thank you again for your updated answer but that seems lot of trouble just to allow me to get a short list of site admins.

    Been doing a lot of googling and finally managed to resolve the problem by using get-pnpuser instead.

    Get-PnPUser | ? IsSiteAdmin -eq $true


    No comments

2 additional answers

Sort by: Most helpful
  1. Echo Du_MSFT 16,841 Reputation points

    @Terry N

    Yes, you are right.

    By design, when a user exceeding usage limits or making too many requests within a single time, SharePoint will return "429 TOO MANY REQUESTS" error. It means SharePoint Online enforce Throttling limits function, in order to preserve service health.

    You could refer to this article Avoid getting throttled or blocked in SharePoint Online to view more information.


    @Terry N

    ……………… Updated Answer ………………

    Enforcing limits scope:

    • 10,000 SharePoint groups per site (site collection).
    • Each SharePoint group can have up to 5,000 users.
    • 5,000 role assignments per uniquely permissioned item.

    Because users of the “Everyone except external users” group exceeds 5000 in your SharePoint Online. I suggest you could split "Everyone except external users" group into several groups. You can follow these steps:

    1.You can group internal external by Departments, such as "Sales Dep", "Personnel Dep", "Finance Dep", etc.
    2.Add users in the "Everyone except external users" group to the corresponding group.
    3.Use these groups to replace the "Everyone except external users" group.
    4.You could run the following commands in the SharePoint Online Management Shell as an admin:

    $admin = ""  
    $password = "****"  
    $cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $admin, $(convertto-securestring $Password -asplaintext -force)  
    Connect-SPOService -Url -Credential $cred  
    $SiteURL= ""  
    Get-SPOUser -Site $SiteUrl -Limit All | select DisplayName,LoginName,IsSiteAdmin,IsGroup,@{n="Groups";e={$_.Groups -join ";"}} | Export-Csv "D:\report.csv"  

    Echo Du


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    No comments

  2. Terry N 116 Reputation points

    Thank you for your answer, I have already looked at the Throttling limits page several times to try and work out a way around this but not having much luck.

    So my question was to see if somebody had found a solution for getting Site Admins by any other means using a powershell script.