Hello Arden Asher,
Thanks for reaching out!
You can use $filter to get all users with a mail that ends with '******@domain.com', including a count of returned objects, with the results ordered by userPrincipalName.
To negate the result of the expression inside this clause, use the not
operator, not the ne
operator. For example, the following query retrieves only users whose domain does not end with @contoso.com
.
GET https://graph.microsoft.com/v1.0/users?$filter=not(mail,'******@contoso.com')&$orderby=userPrincipalName&$count=true
ConsistencyLevel: eventual
Hope this helps. If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.