Using Power Bi to report licenses
Lets start with the challenges:
It is very difficult to get reporting on licenses on Azure and use this information to make useful decision on purchase, renewal or True-up/True-Down
If you have multi companies this becomes even more complex to manage and time consuming to get a proper report/dashboard with license data.
Over-licensing without cleanup causing users not able to access resources. However, this may also be caused by :
- licenses not yet available by supplier
- new licenses deployed on the Azure portal with limited quantities thus having over assigned licenses and a new license without any assignments
- What is needed
- The Script
- Get list of users
- Get licenses
- Change license names to simpler names
- Export to Storage Account table and blob
- Get disabled users
- Export to Storage Account blob
- Connect Power BI to the storage table
- Work with the data
- Build report
- Automate report
Prequisites
- Ensure Certificate is not expired in Keyvault on Azure
- RUN VS CODE AS ADMIN
- Install Graph module
-
Install-Module Microsoft.Graph -AllowClobber -Force
- Install EXO module
- Install-Module -Name ExchangeOnlineManagement
- install-module importexcel
- install-module aztable
- Ensure AZ.tables module installed
- Install Az.Storage Module
- install-module az.Storage -Force
#DeviceManagementManagedDevices.Read.All Application Read Microsoft Intune devices Admin consent:Yes
# Exchange.ManageAsApp Application Manage Exchange As Application Admin #consent:Yes