How can I define a conference room in the list of users returned from Microsoft Graph?

I need to return a list of users from Microsoft Graph. I do this through the endpoint / v 1.0 / users.

eg.

https://graph.microsoft.com/v1.0/users/ 

However, it is currently returning accounts for conference rooms configured as Exchange resources.

I don’t see an easy way to find them, and thus it’s easy to filter them from my list.

Does anyone know what I can filter or search in an object that indicates that it is a resource or user account?

+5
source share
3 answers

I have already encountered this problem for some time. However, I just stumbled upon this update, similar to the fact that the new API endpoint for the API in the graphics API can support the distinction between users and rooms / resources: https://dev.office.com/blogs/people-api -available-in-microsoft-graph-v1

I just checked a quick sandbox test confirming this request:

 GET https://graph.microsoft.com/v1.0/me/people?$filter=personType/subclass eq 'Room' 

returns a list of my tenant's resources. It's also nice that the permission of User.ReadBasic.All enough for the endpoint /me/people .

+3
source

Currently, Microsoft Graph cannot distinguish whether a mailbox is a user or a room. As a workaround, we can get the numbers using GetRoomLists and GetRooms EWS. Here is an example of getting lists of rooms and rooms for your reference:

 // Return all the room lists in the organization. // This method call results in a GetRoomLists call to EWS. EmailAddressCollection myRoomLists = service.GetRoomLists(); // Display the room lists. foreach (EmailAddress address in myRoomLists) { Console.WriteLine("Email Address: {0} Mailbox Type: {1}", address.Address, address.MailboxType); } private static void GetRooms(ExchangeService service) { // Return all the room lists in the organization EmailAddressCollection myRoomLists = service.GetRoomLists(); // Retrieve the room list that matches your criteria EmailAddress myAddress = new EmailAddress(" building31@contoso.com "); foreach (EmailAddress address in myRoomLists) { if (address == myAddress) { Console.WriteLine("Found {0} in room list", myAddress); } } // Expand the selected collection to get a list of rooms. System.Collections.ObjectModel.Collection<EmailAddress> myRoomAddresses = service.GetRooms(myAddress); // Display the individual rooms. foreach (EmailAddress address in myRoomAddresses) { Console.WriteLine("Email Address: {0}", address.Address); } } 

And if you want Microsoft Graph to differ in the type of mailbox, you can send feedback from the link here .

0
source

Microsoft Graph API updated: you can use the GetRooms method that Fei Xue talked about. This is just a workaround, but it should suit your needs: use https://graph.microsoft.com/beta/me/findRooms to retrieve all the conference rooms in your organization.

0
source

All Articles