Forum Discussion
KirubakaraSen
Jul 13, 2021Copper Contributor
Azure AD - Download users - Missing many users in the export
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 se...
Manoj94
Nov 22, 2021Copper Contributor
You can use either Ms graph or Powershell the ps liner is given below:
Get-AzureADUser -Filter "UserType eq 'Guest'" | select DisplayName, Mail
Get-AzureADUser -Filter "UserType eq 'Guest'" | select DisplayName, Mail
Floris_GS1_NL
Dec 08, 2021Copper Contributor
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
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