Skip to content

Determine windows OEM key #4

@fthobe

Description

@fthobe

Currently the correct windows version has to be identified manually after deploy. Given that it is not safe to downgrade, a reinstall needs to be performed if wrong version is chosen on initial installation:

#region Check for Licensing
$SoftwareLic = Get-WmiObject 'SoftwareLicensingService'
if ( $SoftwareLic.OA3xOriginalProductKey -match '[0-9a-z]{5}-[0-9a-z]{5}-[0-9a-z]{5}-[0-9a-z]{5}-[0-9a-z]{5}' ) {
    if ( $SoftwareLic.OA3xOriginalProductKeyDescription -match 'Pro') {
        write-host "Has a Professional OEM license"
    }
    else {
        write-host "Has a NON Professional OEM License"
    }
}
else { write-host "No OEM license" }
#endregion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions