Share via

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 Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments

1 answer

Sort by: Most helpful
  1. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,551 Reputation points Moderator
    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.

    Was this answer helpful?

    0 comments No comments

Your answer

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