How to list empty Azure AD groups

Stefan Diedericks 125 Reputation points
2023-01-17T07:49:06.32+00:00

I’m having trouble pulling a list of empty Azure Active Directory groups, as there are over 500 groups I need a quicker way to pull a list.

thank you in advance

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,630 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 100.2K Reputation points MVP
    2023-01-17T08:02:56.43+00:00

    Using PowerShell or? Try something like this:

     

    Get-MsolGroup -GroupType Security | ? {(Get-MsolGroupMember -GroupObjectId $_.ObjectId).count -eq 0 }

    A more "modern" approach using the Graph SDK for PowerShell:

    Get-MgGroup | ? {!(Get-MgGroupMember -GroupId $_.Id)}

    0 comments No comments

0 additional answers

Sort by: Most helpful