Skip to main content

Notifications

Power Automate - General Discussion
Answered

O365 License Summary (used & available) via Flow

(0) ShareShare
ReportReport
Posted on by 34

Hi guy's,

 

I am trying to build a flow that will show me a summary of the licenses I have in my tenant. More importantly it needs to show me how many licenses i have as well as how many have been used.

 

What i have done is built an Azure App and then i run a GET using the tenant ID and secret

david_ashworth_0-1635304463881.png

 

I then run a parse and a filter (in this case i am looking for how many E3 licenses i have). I then get this in the body

david_ashworth_1-1635304611567.png

 

This shows me i have 509 of which 506 are in use. My question is: Is there a better way to do this in Flow or do i need to go down the PowerShell route? I have seen some posts about how they are using this method to get an alert when a particular license has none free. In my case i would like an on demand summary of licenses across my tenant.

 

If i am to use the above scenario, what would be the best way to extract that data to make it easily useable in variable that i can pop in an email?

 

Thanks,
David

  • Ellis Karim Profile Picture
    Ellis Karim 10,517 on at
    O365 License Summary (used & available) via Flow
    There is always going to be some delay between the time new licenses are purchased and for those new licenses to register and appear in Entra ID/Azure.
     
    In my organisation we can purchase directly from Microsoft or through a supplier portal. It only takes a few minutes for the new licenses to register, but there is a short delay. Your experiences may be different.
     
    So when you run your flow, that flow run is only ever going to be a snapshot in time of the license count.
     
    If the new licenses were successfully registered in Entra ID/Azure before or during the flow run (AND before count the licenses actions were executed in the flow),  the license count will be updated.
     
    It's important to include the date and time of the flow run in any email communications.
     
    Ellis
     
     
     
  • twriggles24 Profile Picture
    twriggles24 72 on at
    O365 License Summary (used & available) via Flow
    Hello,
     
    Ekarim, I tried your answer and it worked really well (thanks!) but if I were to increase the licence count whilst the flow is running, would the variables adjust automatically?
     
    I've put a step in my flow to email sales to increase the licence count and then wait but I'm not sure that even if the count increased, would the flow variables pick this change.
     
     
  • AAM365 Profile Picture
    AAM365 2 on at
    Re: O365 License Summary (used & available) via Flow

    I'm getting the following error:

    AAM365_0-1710869742824.png

     

  • Ellis Karim Profile Picture
    Ellis Karim 10,517 on at
    Re: O365 License Summary (used & available) via Flow

    To view the output of the HTTP action in a more meaningful way, paste the output into a JSON formatter such as Best JSON Viewer and JSON Beautifier Online (codebeautify.org)

     

    2021-10-28_00-42-28.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Verified answer
    Ellis Karim Profile Picture
    Ellis Karim 10,517 on at
    Re: O365 License Summary (used & available) via Flow

    Try the following which will get you the consumed units and prepaid units. Insert the correct SKU in the filter array action:

    2021-10-28_00-31-52.png

    2021-10-28_00-30-10.png

    This is the output of the run:

    ekarim2020_0-1635377797828.png

     

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard