Filtering 'shared mailbox users' with Graph API on Office 365 tenants - office365api

I am listing the users in the Office 365 tenant using Graph API version 1.6 following this documentation.
I would like to filter the Office 365 shared mailboxes that are referenced as users and then returned when requesting /users/. (ex. contact#contoso.com, support#contoso.com).
From what I can see there is no way to distinguish a user representing a shared mailbox and a 'regular' user. Is someone has a mechanism to filter such mailboxes? Not that in my case the JSON member userType is always null.

Related

Query Files of another One Drive for Business User's Files using MS Graph API as Global Admin

I can query my own One Drive for Business account files as 'The Global Admin' using Microsoft Graph API. I cannot query another One Drive for Business user's files as 'The Global Admin' using Microsoft Graph API.
Own Files:
https://graph.microsoft.com/v1.0/me/drive/root/children
Another User:
https://graph.microsoft.com/v1.0/users/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/drive/root/children
I am using an Azure AD registered app with following Application permissions:
Files.ReadWrite.All
Sites.Read.All
Sites.ReadWrite.All
User.ReadWrite.All
offline_access
However, when I go to Office 365 Admin and
Choose that another One Drive for Business user (for which I could not query files using MS Graph API) => OneDrive => Get access to files => Click Create link files
then I can successfully query that another user's files using MS Graph API.
If Global Admin needs to query files of all user accounts using MS Graph API when there are 100s of users then this method might not be practical.
Is there any easier way or programmatically possible to give Global Admin the permissions to query files of all user accounts using MS Graph API. If yes, how do we do that.
Thanks!
As you've observed, a tenant admin cannot implicitly access any user's content. You have the power to grant yourself that access but that is cumbersome to do at scale. If you're a tenant admin you have another option though - use an "app-only" (i.e. application permissions) token. You'll have to consent the app for your tenant, but after that it can access content across your tenancy.

How to scan all O365 roles and users who has got which role Using MS Graph endpoint

Anyone please help on how to get all the Office-365 roles and users for example who has got which roles (Azure, O365, SharePoint, etc other workloads …) Using MS Graph endpoint.
Unable able to find MSGraph endpoint to get the roles assigned to a user or a group of users.
Appreciate your help in advance.
You can use List members to retrieve a list of the users that are assigned to the directory role. Similarly, List directoryRoles can be used to get a list of the directory roles that are activated in the tenant.
Please refer to Administrator roles for Microsoft 365 services to determine the roles for which API content is available.

How to identify if an Office 365 group has guests via MS graph API or via any other method?

I am setting up housekeeping process for guests accounts in Azure AD and for that purpose I want to know which Office 365 groups have Guests as members. How can I identify those groups which are externally shared via MS Graph API? Is there any property available?
You could look with reportRoot: getOffice365GroupsActivityDetail
https://learn.microsoft.com/en-us/graph/api/reportroot-getoffice365groupsactivitydetail?view=graph-rest-1.0
It seems this endpoint can give you "External Member Count" with the "Group Display Name"

Graph Explorer does not appear to support EDU endpoints

Currently, Graph Explorer does not appear to support EDU endpoints. Is there a way to work around this problem?
According to your descriptions, I presume you want to find whether there is a wat to support EDU endpoints or not.
Base on my test, we can use the API like this:
GET /education/schools
It will return a collection of educationSchool objects in the response body.
In this document, we can find that this API support the work or school account. If we use a personal microsoft account to login the Graph Explore, it will not support the EDU endpoints.
The default tenant (i.e. the tenant data you get when you haven't logged into Graph Explorer) does include Edu data.
If you are authenticating, you will only be able to call the Edu endpoints if you have consented to the Edu scopes and your tenant is an Office 365 Education instance. These endpoints will not work with a non-Edu O365 tenant.

Global Address List Graph API

I am trying to use the Graph API inside an Office 365 add-in to get contact information out of GAL. Neither of the following queries return any contacts from the GAL, although both return some information.
beta/me/contacts?$filter=displayName eq 'John Smith'
beta/me/people?$filter=displayName eq 'John Smith'
Is it possible to get contacts from the GAL using the Graph API? I having a feeling I am not giving my app the correct permission to access the GAL.
The /me/contacts endpoint returns the contacts from your default Outlook Contacts folder. The /me/people endpoint is similar but attempts to pull information on contacts access multiple sources.
The GAL represents contact information from your organization (i.e. Active Directory). To see the contact information for other users in your organization, you use the /users endpoint. To see organizational contacts (contacts added to the AD/GAL) you need to use the /contacts endpoint (note the lack of /me/ in the path).

Resources