Office 365 API - creating a new user, obtaining information about licensing; Which API to use?

My search for this has completely returned, I'm not even sure that this is possible.

It is possible in Powershell, and I already do it in Powershell, but I want to write a C # program to perform certain tasks and cannot find which API will perform such tasks:

1) Get licensing information for all users and their designated plans.

2) Get a list of all mailboxes and email addresses for a specific Office 365 tenant.

It’s easy to do in Powershell, but is there any API that will perform these common management tasks ?! If there is, I cannot find it, so that any direction is useful.

+7
c # office365 microsoft-graph
source share
1 answer

To do this, you must use the Microsoft Graph API, which can be used in native applications and web applications. When connecting to Microsoft Graph, several examples are available. A link to the API can be found here: http://graph.microsoft.io

Or try using Graph Explorer to try the API: https://graphexplorer2.azurewebsites.net

To get users with assigned licenses:

First get a signed Skus from your tenant using: https://graph.windows.net/rbd3v.onmicrosoft.com/subscribedSkus (Where rbd3v.onmicrosoft.com should be replaced by your tenant)

Then you can get all users with assigned licenses: https://graph.windows.net/rbd3v.onmicrosoft.com/users

Which will return something like this:

result

SkuId from the assigned resources will correspond to the license obtained from the first request.

Get a list of mailboxes

Similarly, you can receive all mailboxes. Retrieving all the users and groups of your tenant and retrieving their email address. Overview of available queries: https://msdn.microsoft.com/Library/Azure/Ad/Graph/api/api-catalog

Hope this helps you!

+5
source share

All Articles