I would like to list out all our departmentnames fra Microsoft Graph (graph.microsoft.com). I guess that the only way to do this is throught the list of users, please correct me if I am wrong.
So my question is, is there any way to query users for Departments and only distinct values of Departments?
This code does not work, but just to you an idea of where I want:
https://graph.microsoft.com/v1.0/users?$Select=Department&$Distinct(Department)