Forum Discussion
Vanir10
Mar 14, 2023Copper Contributor
Get-AzureAdUser not working as expected.
Okay so if I run Get-AzureAdUser -Filter "userType eq 'Guest'" I get a list of users as expected that all have a user type of "Guest". However this list is missing users. If I run ...
- Mar 15, 2023-All is a Boolean parameter, try this:
Get-AzureAdUser -Filter "userType eq 'Guest'" -All:$true
Better yet, switch to the Graph module:
Get-MgUser -Filter "userType eq 'Guest'" -All
Vanir10
Mar 15, 2023Copper Contributor
Get-MgUser -Filter "userType eq 'Guest'" -All
Definitely works better than what I was using and I will be using that in the future.
Although I'm still not sure why (Get-AzureAdUser -Filter "userType eq 'Guest'") wasn't returning some results?
VasilMichev
Mar 15, 2023MVP
It uses an older version of the API. If you want to stick to the AzureAD module, try using the Preview branch (AzureADPreview module) and the following:
Get-AzureAdMSUser -Filter "userType eq 'Guest'" -All:$true
Get-AzureAdMSUser -Filter "userType eq 'Guest'" -All:$true