question

tallywizu-8524 avatar image
0 Votes"
tallywizu-8524 asked AnshulKumarMINDTREELIMITED-5501 commented

powershell script to export all the groups and group members from Azure AD


2

Please I need help with a powershell script that can export all the groups and group members of an azure ad and their attributes to a storage account, table storage

Get a list of all Groups in AD first (Get-AzADGroup)

Loop through all Groups and get Members of the group

Loop through all members and get the member info (userprincipal, userid, user, givenname, surname, usertype, accountenabled, etc.) (Get-AzADGroupMember)

Connect to Table Storage (Get-AzStorageAccount)
Get Table Storage Rows (Get-AzTableRow)
Add a Table Row to Table Storage (Add-AzTableRow) using a consistent row key

azure-active-directorywindows-server-powershell
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, if the posted answer resolves your question, please mark it as the answer by clicking the check mark. Doing so helps others find answers to their questions.

0 Votes 0 ·

1 Answer

JamesHamil-MSFT avatar image
0 Votes"
JamesHamil-MSFT answered

Hi @tallywizu-8524 , have you looked into bulk downloading? https://docs.microsoft.com/en-us/azure/active-directory/enterprise-users/groups-bulk-download-members

This may be faster than creating a PowerShell script. Please let me know if you have any questions!

Best,
James

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.