In order to license all Windows machines(Physical and Virtual), a big and very complex table had to be sent to Microsoft.
While the licensing formula needed some data that could not be properly exported, a tramendeous effort was necessary to re-create the table every year.
I have developed a script to collect all informations, about all Windows machines and figure out how much resources are used in every clusters for running Windows machines, add the resources, add the spare capacity(not always required), and figure out the number of hosts to be licensed. At this step, I had to calculate the number of cores to be licensed based on the cluster usage and some other factors.
The final result is an exportable Kibana table with the exact number of vms, cores and host, and the additional information for each of them(serial number, RAM, HW vendor, etc.).