PowerShell script to Export All Azure AD groups Starting with "ABC" name and membership of their groups

Kevin Alive 6 Reputation points
2020-10-26T16:37:43.117+00:00

PowerShell script to Export All Azure AD groups Starting with "ABC" name and membership of their groups

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

1 answer

Sort by: Most helpful
  1. 2020-10-26T18:18:50.943+00:00

    Hello @Kevin Alive . Here it is:

       Get-AzureADGroup -Filter "startswith(displayName,'D')"|foreach  { $m=Get-AzureADGroupMember -ObjectId $_.ObjectId ; $o=[PSCustomObject]@{  
        Group = $_  
        Members = $m  
       }; $o }|ConvertTo-Json -Depth 5|Out-File -FilePath .\groups-starting-with-abc.json  
    

    Let us know if this answer was helpful to you. If so, please remember to mark it as the answer so that others in the community with similar questions can more easily find a solution.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.