title: Need Script to find server activation status
body: <p>We have an environment with different domains and forests with and without trusts.</p>
  
  <p>I need to manage the license for these with out KMS.</p>
  
  <p>I want to find out the servers which are running without activated or with Grace period.</p>
  
  <p>I have been trying with differnt scripts from WMIC and Powershell. But, not able to generate with clear and clean.</p>
  
  <p>Below are the scripts tried. I need assistance on this.</p>
  
  <p>From WMIC:</p>
  
  <pre><code>WMIC /Output:@D:\output.txt /node:@D:\serverslist.txt PATH SoftwareLicensingProduct WHERE "ProductKeyID like '%-%' AND Description like '%Windows%'" get LicenseStatus 
  </code></pre>
  
  <p>From Powershell:</p>
  
  <pre><code>PS C:\Windows\system32&gt; Get-CimInstance -ClassName SoftwareLicensingProduct |where PartialProductKey |select PScomputername,LicenseStatus
  </code></pre>
  
  <p>I need help to generate a table with computer name/IP and license status.</p>
  
  <p>Thanks in advance.</p>