I'm trying to find out the best way to check Windows License status using WMI query. The query should return one row indicating the license status and I want it to be as general as possible so that I can run it on many computers and different versions of operating systems.
So far have the following one:
SELECT LicenseStatus, Name, ApplicationID FROM SoftwareLicensingProduct
The problem is that it returns many rows. For example if there is Office installed it's also included in the query results and I don't know how to limit the results.