title: Get-WmiObject : Invalid class "SoftwareLicensingProduct"
body: <p>I'm new to powershell and am trying to write a program that will get the product key of numerous servers.</p>
  
  <p>I am looping through the server names and trying to do the following code but am getting the error in the title</p>
  
  <pre><code>$LicenseInfo = Get-WmiObject -Class SoftwareLicensingProduct -ComputerName $target -Credential $cred  | ` 
  Where-Object { $_.PartialProductKey -and $_.ApplicationID -eq "55c92734-d682-4d71-983e-d6ec3f16059f" } | Select-Object PartialProductKey, Description, ProductKeyChannel, @{ N = "LicenseStatus"; E = { $lstat["$($_.LicenseStatus)"] } } 
  </code></pre>
  
  <p>Any help would be appreciated</p>