Microsoft Graph – Frequently used Graph API Queries for Users – Part 1

Hi All,
Greetings for the day!!!
I am compiling frequently used Microsoft Graph APIs. In this series of articles today we are listing all queries related to users count and users listing. All these queries are “Get“
Also explore different parameters to Graph queries like – Filter, Search, OrderBy, Select
Following API permissions will require to execute / use following queries

Queries related Users count in tenant
- Get all users count from my tenant including guest users
- Method : GET
https://graph.microsoft.com/v1.0/users/$count
- Get all users count from my tenant except guest users
- Method : GET
- Details :
- We could have filter based on “userType” property
- For guest users “userType” is “guest“
https://graph.microsoft.com/v1.0/users/$count?$filter=userType ne 'guest'
- Get all guest users count from my tenant
- Method : GET
https://graph.microsoft.com/v1.0/users/$count?$filter=userType eq 'guest'
Listing of Users
- Get all users from my tenant
- Method : GET
https://graph.microsoft.com/v1.0/users
- Get all users from my tenant except guest users
- Method : GET
https://graph.microsoft.com/v1.0/users/?$filter=userType ne 'guest'
- Get all guest users from my tenant
- Method : GET
https://graph.microsoft.com/v1.0/users/?$filter=userType eq 'guest'
- Get all users with sort by / order by display name property
- Method : GET
https://graph.microsoft.com/v1.0/users?$count=true&$orderBy=displayName

- Get all users with selected properties
- Method : GET
https://graph.microsoft.com/v1.0/users?$select=id,displayName,mail,userPrincipalName
- Get all users of my tenant with filter based on properties – here we will filter “department” property
- Method : GET
https://graph.microsoft.com/v1.0/users?$count=true&$filter=Department eq 'IT'
- Users with containing value in specific property – here for example – we will find all users whose display name contains “knowledge”
- Method : GET
https://graph.microsoft.com/v1.0/users?$search="displayName:knowledge"

Thanks for reading !!! If its worth at least reading once, kindly please like and share !! SHARING IS CARING 🙂
Enjoy the beautiful life !!! Have a FUN !!! TAKE CARE 🙂
1 Response
[…] In last article we discussed – listing all queries related to users count and users listing. All these queries are “Get” – Microsoft Graph – Frequently used Graph API Queries for Users – Part 1 […]
You must log in to post a comment.