How to list all internal users?

Jan Nielsen 6 Reputation points
2021-01-24T14:21:05.63+00:00

I need to list all non-external users (federated from on-prem AD or cloud users), either by using AzureAD cmdlets or the Graph API.
But I am having problems with the filter clause.

I do not want to use userType becuase it can be changed, and does not necessarily show if a user is internal or external. Instead I am trying to use creationType or externalUserState.

For both of these I can do something like: creationType eq 'Invitation' to find external users.
But how can I do the opposite?

Non of the following works:
creationType eq ''
creationType eq null
creationType ne 'Invitation'
not creationType eq 'Invitation'

Will I have to extract all users, and do the filtering afterwards?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,464 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 21,621 Reputation points Microsoft Employee
    2021-01-25T22:00:23.793+00:00

    Have you tried using an HTTP request? It might suit your needs better. If this doesn't work for what you need I can help you with creationType. Please let me know.

    Thank you,

    James

    0 comments No comments