Get product key

Handian Sudianto 5,821 Reputation points
2024-08-13T13:59:11.0733333+00:00

Can we get the windows product key using power shell?

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,726 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 57,316 Reputation points
    2024-08-13T14:27:09.56+00:00

    It is available via WMI. Try this.

    (Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey
    

    Note that product keys are mostly being replaced by digital licenses. Therefore this may not work on machine that are using only digital licenses tied to an MS account.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.