Forum Discussion

PWheeler's avatar
PWheeler
Copper Contributor
Mar 02, 2020

O365 licensing datasource?

I'd like to access my O365 licensing data in a more efficient way. 

Currently I go to the admin console, go to a licence type, E3 for example, hit export and then import the resulting csv into Excel. Rinse and repeat for other license types.

I can't find any data on accessing my license data via an API, but that's what I'm after - being able to get to this data dynamically without all the manual steps as a datasource in either Excel or Access.

Any ideas?

  • orchee's avatar
    orchee
    Mar 02, 2020

    PWheeler So there is List License details for users -> click 

     

    If you want to go deeper on usage, then you need to go through usage reports, so just keep your expectations low on more details 🙂

  • orchee's avatar
    orchee
    Iron Contributor

    PWheeler You can do it by accessing MS Graph:
    https://graph.microsoft.com/v1.0/subscribedSkus

     

    You need to give your account permissions listed here 

    {
        "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscribedSkus",
        "value": [
            {
                "capabilityStatus": "Enabled",
                "consumedUnits": 1,
                "id": "xxxxx-xxx-xx-xxxxx-xxxxxxxxx-xxx-xxxx-xxx-xxxxxx",
                "skuId": "xxxxxx-xxxxx-xxx-xxxxx-xxxxx",
                "skuPartNumber": "O365_BUSINESS_ESSENTIALS",
                "appliesTo": "User",
                "prepaidUnits": {
                    "enabled": 1,
                    "suspended": 0,
                    "warning": 0
                },
                "servicePlans": [
                    {
                        "servicePlanId": "xxxxxx-xxxx-xxxxxx-xxxx-xxxxxxx",
                        "servicePlanName": "MICROSOFT_SEARCH",
                        "provisioningStatus": "Success",
                        "appliesTo": "Company"
                    },
                    {
                        "servicePlanId": "xxxxxxxx-xxxx-xxxxx-xxx-xxxxxxx",
                        "servicePlanName": "WHITEBOARD_PLAN1",
                        "provisioningStatus": "Success",
                        "appliesTo": "User"
                    }
                ]
            }
        ]
    }

     

    • PWheeler's avatar
      PWheeler
      Copper Contributor

      orchee I'm clearly going to have to do some reading up on Graph - that looks very powerful.

      This endpoint though seems limited to summary data - number of each licence type. 

      I'm after something closer to the export data from the management console - A list of users for each licence type with data about last use timestamp and date created.

      I will find a few hours to go through the Graph endpoints but, off the top of your head, do you know if this is possible?

      • orchee's avatar
        orchee
        Iron Contributor

        PWheeler So there is List License details for users -> click 

         

        If you want to go deeper on usage, then you need to go through usage reports, so just keep your expectations low on more details 🙂

    • VitalieCiobanu's avatar
      VitalieCiobanu
      Brass Contributor
      Hi Grzesiek,

      Besides Graph and manual export, is there another way to export all licenses for each product and users using these licenses?

      We need this data weekly in order to connect it with our internal data for some specific dashboards.

      Thank you.
      • orchee's avatar
        orchee
        Iron Contributor

        VitalieCiobanu : Are these options not enough in your case scenario? If you are looking for "click to generate report in csv" option OOTB I have not encountered one yet.

Resources