Oct 16 2022
10:20 PM
- last edited on
Feb 01 2023
11:06 AM
by
TechCommunityAP
Oct 16 2022
10:20 PM
- last edited on
Feb 01 2023
11:06 AM
by
TechCommunityAP
Is there a filter for this command to get only users and no rooms and resources as result?
Oct 17 2022 01:44 AM
@Benjamin1998 Get-MgUser -All -Filter "userType eq 'member'"
See https://office365itpros.com/2022/03/24/azure-ad-user-account-powershell/ for lots more about Get-MgUser
Oct 17 2022 01:56 AM
Oct 17 2022 02:46 AM
Oct 17 2022 04:10 AM
Solution@Benjamin1998 Azure AD doesn’t distinguish between an account used by a human and one used by a resource, like a shared mailbox. You’ll have to filter the set returned to get the data you want. This is one reason why I often use Get-
ExoMailbox instead as it’s easier to filter the set.
Oct 17 2022 04:33 AM
May 31 2023 07:30 PM - edited May 31 2023 07:31 PM
Hi @Benjamin1998
Maybe you already know this, but you know you could use Select-MgProfile beta as it will provide you with more attributes (163 instead of 138 @time of this reply).
I found “AssignedLicenses” useful.
Please remember that beta can change any time and MS does not recommend it for production.
Oct 17 2022 04:10 AM
Solution@Benjamin1998 Azure AD doesn’t distinguish between an account used by a human and one used by a resource, like a shared mailbox. You’ll have to filter the set returned to get the data you want. This is one reason why I often use Get-
ExoMailbox instead as it’s easier to filter the set.