Forum Discussion
Benjamin1998
Oct 17, 2022Copper Contributor
Get-MgUser - how to get only users?
Is there a filter for this command to get only users and no rooms and resources as result?
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.
8 Replies
- zegCopper Contributor
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. - Benjamin1998Copper ContributorI can't find solution there.
- Well, even the examples show some pointers. You better head off to Tonys article.