title: What is the best way to check Windows License Status using WMI query
body: <p>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.</p>
  
  <p>So far have the following one:</p>
  
  <pre><code>SELECT LicenseStatus, Name, ApplicationID FROM SoftwareLicensingProduct
  </code></pre>
  
  <p>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.</p>