Created
November 23, 2017 19:37
-
-
Save HumanEquivalentUnit/4d59394f8601f49ec8e4bce201e03ecc to your computer and use it in GitHub Desktop.
Get Windows activation status, taken from slmgr.vbs and ignoring KMS and AD and other product licensing, and older versions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-CimInstance -ClassName SoftwareLicensingProduct | | |
Where-Object {$_.ApplicationId -eq "55c92734-d682-4d71-983e-d6ec3f16059f" -and $_.PartialProductKey } | | |
Select-Object Name, | |
@{Name="LicenseStatus"; Expression = { | |
switch ($_.LicenseStatus) { 0 { "Unactivated"} | |
1 { "Activated" } | |
default { "unknown" } | |
} } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment