Microsoft Azure AD Graph API: Fetch pro-rated license informations of users












0















I have been going through the api docs of Microsoft Azure AD Graph API and am unable to find a way to fetch the prorated licenses of a user.



The problem is that the api only returns the skuids when asked for all the licenses attached to a user.



For e.g.
https://graph.windows.net/#TENANTID#/users/#USERPRINCIPALNAME#/licenseDetails?api-version=1.6



"value": [
{
"objectId": "VdVcDxIjW0WEg5x0-5H2jbAFlEuId2hFrdGZYU5hO2k",
"servicePlans": [
{
"servicePlanId": "88882e1d05-acd1-4ccb-8708-6ee036647",
"servicePlanName": "INTUNE_O365",
"provisioningStatus": "PendingActivation",
"appliesTo": "Company"
},
{
"servicePlanId": "1209af7827-d63c-4b61-89c3-182f06f82c",
"servicePlanName": "EXCHANGE_S_STANDARD",
"provisioningStatus": "Success",
"appliesTo": "Company"
}
],
"skuId": "67buyt0-7788-4568-add1-99614e6ty89",
"skuPartNumber": "EXCHANGESTANDARD"
}
]


We will be able to identify the tenant subscribed skus from the request https://graph.windows.net/#TENANTID#/subscribedSkus?api-version=1.6



However we cannot figure out when a license(sku) was added/removed to a user. Is such functionality possible via the AADGraph REST API?










share|improve this question



























    0















    I have been going through the api docs of Microsoft Azure AD Graph API and am unable to find a way to fetch the prorated licenses of a user.



    The problem is that the api only returns the skuids when asked for all the licenses attached to a user.



    For e.g.
    https://graph.windows.net/#TENANTID#/users/#USERPRINCIPALNAME#/licenseDetails?api-version=1.6



    "value": [
    {
    "objectId": "VdVcDxIjW0WEg5x0-5H2jbAFlEuId2hFrdGZYU5hO2k",
    "servicePlans": [
    {
    "servicePlanId": "88882e1d05-acd1-4ccb-8708-6ee036647",
    "servicePlanName": "INTUNE_O365",
    "provisioningStatus": "PendingActivation",
    "appliesTo": "Company"
    },
    {
    "servicePlanId": "1209af7827-d63c-4b61-89c3-182f06f82c",
    "servicePlanName": "EXCHANGE_S_STANDARD",
    "provisioningStatus": "Success",
    "appliesTo": "Company"
    }
    ],
    "skuId": "67buyt0-7788-4568-add1-99614e6ty89",
    "skuPartNumber": "EXCHANGESTANDARD"
    }
    ]


    We will be able to identify the tenant subscribed skus from the request https://graph.windows.net/#TENANTID#/subscribedSkus?api-version=1.6



    However we cannot figure out when a license(sku) was added/removed to a user. Is such functionality possible via the AADGraph REST API?










    share|improve this question

























      0












      0








      0








      I have been going through the api docs of Microsoft Azure AD Graph API and am unable to find a way to fetch the prorated licenses of a user.



      The problem is that the api only returns the skuids when asked for all the licenses attached to a user.



      For e.g.
      https://graph.windows.net/#TENANTID#/users/#USERPRINCIPALNAME#/licenseDetails?api-version=1.6



      "value": [
      {
      "objectId": "VdVcDxIjW0WEg5x0-5H2jbAFlEuId2hFrdGZYU5hO2k",
      "servicePlans": [
      {
      "servicePlanId": "88882e1d05-acd1-4ccb-8708-6ee036647",
      "servicePlanName": "INTUNE_O365",
      "provisioningStatus": "PendingActivation",
      "appliesTo": "Company"
      },
      {
      "servicePlanId": "1209af7827-d63c-4b61-89c3-182f06f82c",
      "servicePlanName": "EXCHANGE_S_STANDARD",
      "provisioningStatus": "Success",
      "appliesTo": "Company"
      }
      ],
      "skuId": "67buyt0-7788-4568-add1-99614e6ty89",
      "skuPartNumber": "EXCHANGESTANDARD"
      }
      ]


      We will be able to identify the tenant subscribed skus from the request https://graph.windows.net/#TENANTID#/subscribedSkus?api-version=1.6



      However we cannot figure out when a license(sku) was added/removed to a user. Is such functionality possible via the AADGraph REST API?










      share|improve this question














      I have been going through the api docs of Microsoft Azure AD Graph API and am unable to find a way to fetch the prorated licenses of a user.



      The problem is that the api only returns the skuids when asked for all the licenses attached to a user.



      For e.g.
      https://graph.windows.net/#TENANTID#/users/#USERPRINCIPALNAME#/licenseDetails?api-version=1.6



      "value": [
      {
      "objectId": "VdVcDxIjW0WEg5x0-5H2jbAFlEuId2hFrdGZYU5hO2k",
      "servicePlans": [
      {
      "servicePlanId": "88882e1d05-acd1-4ccb-8708-6ee036647",
      "servicePlanName": "INTUNE_O365",
      "provisioningStatus": "PendingActivation",
      "appliesTo": "Company"
      },
      {
      "servicePlanId": "1209af7827-d63c-4b61-89c3-182f06f82c",
      "servicePlanName": "EXCHANGE_S_STANDARD",
      "provisioningStatus": "Success",
      "appliesTo": "Company"
      }
      ],
      "skuId": "67buyt0-7788-4568-add1-99614e6ty89",
      "skuPartNumber": "EXCHANGESTANDARD"
      }
      ]


      We will be able to identify the tenant subscribed skus from the request https://graph.windows.net/#TENANTID#/subscribedSkus?api-version=1.6



      However we cannot figure out when a license(sku) was added/removed to a user. Is such functionality possible via the AADGraph REST API?







      azure azure-active-directory azure-ad-graph-api






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 22 '18 at 11:08









      active_coderactive_coder

      2418




      2418
























          1 Answer
          1






          active

          oldest

          votes


















          0














          As far as I known, if you want to add or remove the license from a user, you can use this Azure AD Graph API :



          Method : Post

          Endpoint : https://graph.windows.net/myorganization/users/{user_id}/assignLicense?api-version


          For more details, please refer to the document.






          share|improve this answer
























          • Thanks for your time posting a suggestion. However my query was not on how to add/remove licenses via the api. My intention was to get the data of the licenses added/removed for users in a tenant.

            – active_coder
            Nov 27 '18 at 13:06











          • HI. According to my understanding, you want to get the record of the licenses added/removed for users in a tenant. If so, you can get the record from Audit logs(docs.microsoft.com/en-us/azure/active-directory/…) in Azure AD.

            – Jim
            Nov 28 '18 at 1:39











          • If you want to use API to get Audit logs, you can use Reporting API to get it. For more details, please refer to (docs.microsoft.com/en-us/azure/active-directory/…).

            – Jim
            Nov 28 '18 at 1:52











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53429611%2fmicrosoft-azure-ad-graph-api-fetch-pro-rated-license-informations-of-users%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          As far as I known, if you want to add or remove the license from a user, you can use this Azure AD Graph API :



          Method : Post

          Endpoint : https://graph.windows.net/myorganization/users/{user_id}/assignLicense?api-version


          For more details, please refer to the document.






          share|improve this answer
























          • Thanks for your time posting a suggestion. However my query was not on how to add/remove licenses via the api. My intention was to get the data of the licenses added/removed for users in a tenant.

            – active_coder
            Nov 27 '18 at 13:06











          • HI. According to my understanding, you want to get the record of the licenses added/removed for users in a tenant. If so, you can get the record from Audit logs(docs.microsoft.com/en-us/azure/active-directory/…) in Azure AD.

            – Jim
            Nov 28 '18 at 1:39











          • If you want to use API to get Audit logs, you can use Reporting API to get it. For more details, please refer to (docs.microsoft.com/en-us/azure/active-directory/…).

            – Jim
            Nov 28 '18 at 1:52
















          0














          As far as I known, if you want to add or remove the license from a user, you can use this Azure AD Graph API :



          Method : Post

          Endpoint : https://graph.windows.net/myorganization/users/{user_id}/assignLicense?api-version


          For more details, please refer to the document.






          share|improve this answer
























          • Thanks for your time posting a suggestion. However my query was not on how to add/remove licenses via the api. My intention was to get the data of the licenses added/removed for users in a tenant.

            – active_coder
            Nov 27 '18 at 13:06











          • HI. According to my understanding, you want to get the record of the licenses added/removed for users in a tenant. If so, you can get the record from Audit logs(docs.microsoft.com/en-us/azure/active-directory/…) in Azure AD.

            – Jim
            Nov 28 '18 at 1:39











          • If you want to use API to get Audit logs, you can use Reporting API to get it. For more details, please refer to (docs.microsoft.com/en-us/azure/active-directory/…).

            – Jim
            Nov 28 '18 at 1:52














          0












          0








          0







          As far as I known, if you want to add or remove the license from a user, you can use this Azure AD Graph API :



          Method : Post

          Endpoint : https://graph.windows.net/myorganization/users/{user_id}/assignLicense?api-version


          For more details, please refer to the document.






          share|improve this answer













          As far as I known, if you want to add or remove the license from a user, you can use this Azure AD Graph API :



          Method : Post

          Endpoint : https://graph.windows.net/myorganization/users/{user_id}/assignLicense?api-version


          For more details, please refer to the document.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 26 '18 at 2:47









          JimJim

          1024




          1024













          • Thanks for your time posting a suggestion. However my query was not on how to add/remove licenses via the api. My intention was to get the data of the licenses added/removed for users in a tenant.

            – active_coder
            Nov 27 '18 at 13:06











          • HI. According to my understanding, you want to get the record of the licenses added/removed for users in a tenant. If so, you can get the record from Audit logs(docs.microsoft.com/en-us/azure/active-directory/…) in Azure AD.

            – Jim
            Nov 28 '18 at 1:39











          • If you want to use API to get Audit logs, you can use Reporting API to get it. For more details, please refer to (docs.microsoft.com/en-us/azure/active-directory/…).

            – Jim
            Nov 28 '18 at 1:52



















          • Thanks for your time posting a suggestion. However my query was not on how to add/remove licenses via the api. My intention was to get the data of the licenses added/removed for users in a tenant.

            – active_coder
            Nov 27 '18 at 13:06











          • HI. According to my understanding, you want to get the record of the licenses added/removed for users in a tenant. If so, you can get the record from Audit logs(docs.microsoft.com/en-us/azure/active-directory/…) in Azure AD.

            – Jim
            Nov 28 '18 at 1:39











          • If you want to use API to get Audit logs, you can use Reporting API to get it. For more details, please refer to (docs.microsoft.com/en-us/azure/active-directory/…).

            – Jim
            Nov 28 '18 at 1:52

















          Thanks for your time posting a suggestion. However my query was not on how to add/remove licenses via the api. My intention was to get the data of the licenses added/removed for users in a tenant.

          – active_coder
          Nov 27 '18 at 13:06





          Thanks for your time posting a suggestion. However my query was not on how to add/remove licenses via the api. My intention was to get the data of the licenses added/removed for users in a tenant.

          – active_coder
          Nov 27 '18 at 13:06













          HI. According to my understanding, you want to get the record of the licenses added/removed for users in a tenant. If so, you can get the record from Audit logs(docs.microsoft.com/en-us/azure/active-directory/…) in Azure AD.

          – Jim
          Nov 28 '18 at 1:39





          HI. According to my understanding, you want to get the record of the licenses added/removed for users in a tenant. If so, you can get the record from Audit logs(docs.microsoft.com/en-us/azure/active-directory/…) in Azure AD.

          – Jim
          Nov 28 '18 at 1:39













          If you want to use API to get Audit logs, you can use Reporting API to get it. For more details, please refer to (docs.microsoft.com/en-us/azure/active-directory/…).

          – Jim
          Nov 28 '18 at 1:52





          If you want to use API to get Audit logs, you can use Reporting API to get it. For more details, please refer to (docs.microsoft.com/en-us/azure/active-directory/…).

          – Jim
          Nov 28 '18 at 1:52




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53429611%2fmicrosoft-azure-ad-graph-api-fetch-pro-rated-license-informations-of-users%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          Alcedinidae

          RAC Tourist Trophy