LLI Wiki — My Digital Knowledge Base

PowerShell: retrieve the Windows product key of a computer

PowerShell function that decodes DigitalProductId through WMI to show the Windows product key of a local or remote computer.

This memo describes a PowerShell function, Get-WindowsKey, that reads the Windows product key of a local or remote computer and displays it with some system information. The function comes from a script by Nedim Mehic; it is not reproduced here in full.

How it works

Usage

The -targets parameter accepts a list of computer names (default ., the local computer):

Get-WindowsKey
Get-WindowsKey -targets "pc01","pc02"

Notes

Mastodon LLIMastodon SocialFosstodon