/build/static/layout/Breadcrumb_cap_w.png

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? 

Thanks



0 Comments   [ + ] Show comments

Answers (1)

Posted by: Nico_K 2 years ago
Red Belt
1

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

 
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