Microsoft Secure Tech Accelerator
Apr 03 2024, 07:00 AM - 11:00 AM (PDT)
Microsoft Tech Community

Azure AD - Download users - Missing many users in the export

Copper Contributor

Hello All,

 

We are downloading the registered Guest users list from Azure portal to track and follow-up on the Invitation registration. In this list, we are missing many users. 

 

But when we search the user individually in the same screen (Active directory-> Users) , we can see those specific users with various status like accepted, pending acceptance etc.  Even we tried various options, cleared the filter and tried the download users again, still we are missing many users.

 

Could somebody help??

 

Regards

Sen

 

5 Replies
Hi,
Have you used PowerShell by any chance?
Hello shehanjp, The issue is resolved. We generated the report with Powershell. thanks.
Hi, we ran into the same problem. Would have been even more helpfull if you could share the powershell commands you used to get the full/complete list.
You can use either Ms graph or Powershell the ps liner is given below:

Get-AzureADUser -Filter "UserType eq 'Guest'" | select DisplayName, Mail
Thank you for your reply. But as often with developers an half answer.
After long searching and many trial and error I found the complete powershell script to get it done.

Get-ExecutionPolicy -List

Set-ExecutionPolicy -ExecutionPolicy remotesigned -scope Process

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Install-Module AzureAD

Get-InstalledModule

Import-Module AzureAD

Connect-AzureAD -Tenant {Your tenant ID}
(also works for Azure B2C)

$users = Get-AzureADUser -All $true

$users | Select-Object -Property Id, GivenName, Surname, { ($_.SignInNames[0] -split '\n')[2] -replace " Value: " } | Export-Csv users.csv