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
Answers (1)
it is much easier.
ShellCommandTextReturn(cmd /c c:\windows\system32\cscript.exe c:\windows\system32\slmgr.vbs -dlv|findstr status)