I am working with Azure AD and need to get all users and export it into csv file and finally put it into SQL.
At this moment we have about 10,000 users. The problem is the PowerShell command [Get-AzureADUser – ALL] it’s SUPER SLOW!! It takes about 58 minutes to complete the task. Today we noticed that some users made changes to their account. I need to update the whole list to find the changes made.
My questions is:
1) Is there a faster way I can get ALL users?
2) How can I only find users who made changes to their account?
Powershell script:
$aadUsers = Get-AzureADUser -All $true | Select DisplayName, ObjectId, userType,GivenName
Get-AzureADAuditDirectoryLogs -All $true -Filter "Category eq 'UserManagement' and result eq 'success'" | Select-Object InitiatedBy
– Jim Xu