custom inventory windows 10 activation check

I'm trying to find windows 10 machines which are and are not activated. I found a powershell script that works but I have not be able to get it to work as customer inventory.

here is the powershell script

Get-CimInstance SoftwareLicensingProduct -Filter "Name like 'Windows%'" | where { $_.PartialProductKey } | select LicenseStatus

I've tried

ShellCommandTextReturn(ShellCommandTextReturn(c:\windows\sysnative\WindowsPowerShell\v1.0\powershell.exe -command "Get-CimInstance SoftwareLicensingProduct -Filter "Name like 'Windows%'" | where { $_.PartialProductKey } | select LicenseStatus")

ShellCommandTextReturn(cmd /q /c powershell -command "Get-CimInstance SoftwareLicensingProduct -Filter "Name like 'Windows%'" | where { $_.PartialProductKey } | select LicenseStatus")

ShellCommandTextReturn(cmd /q /c powershell.exe -ExecutionPolicy Bypass -Command "Get-CimInstance SoftwareLicensingProduct -Filter "Name like 'Windows%'" | where { $_.PartialProductKey } | select LicenseStatus"

None of these work. Could someone please help with this? 


0 Comments   [ + ] Show comments

Answers (1)

Posted by: Nico_K 3 months ago
Red Belt

it is much easier.
ShellCommandTextReturn(cmd /c c:\windows\system32\cscript.exe c:\windows\system32\slmgr.vbs -dlv|findstr status)

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ