从计算机中提取 Windows 10 许可证密钥

从计算机中提取 Windows 10 许可证密钥

整个办公室里有几台运行 Windows 10 的计算机(大约十几台),但我们不清楚我们的哪些许可证在哪台计算机上激活。是否可以从每台计算机中提取当前使用的许可证密钥?

我们不使用 AD 或 KMS 或类似的东西,每台计算机都是为使用它的个人单独设置的。我们知道我们拥有哪些密钥,但我们不知道哪些密钥正在使用以及在哪里使用。我们混合使用了 OEM、MSDN 和“常规”许可证。

答案1

您可以使用 NirSoft 的“ProduKey”。您可以在nirsoft.net。这是一个免费软件实用程序,它不仅允许您查看 Windows 密钥,还允许您查看各种其他 Microsoft 产品密钥。

此方法适用于批量许可证、OEM 和其他独立许可证。

请注意,它并不正式支持 Windows 10,但到目前为止我的体验是成功的。

答案2

进入:

wmic path softwareLicensingService get OA3xOriginalProductKey 

进入命令提示符(管理员),然后按回车键。

这将显示每台机器的原始 Windows 10 产品密钥。

注意:这仅适用于 OEM 许可证。

答案3

如果你在正版 Windows 副本连接到主板(OEM 密钥),您可以在 Windows 管理员命令提示符中使用此命令:

wmic path softwareLicensingService get OA3xOriginalProductKey

或者在管理员 Powershell 中

$(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey

但是,如果您输入了产品密钥或将数字许可证连接到计算机,则此方法无效。您可以使用 VBScript 获取计算机上的产品密钥,如下所示这里由 Hackoo 编写。众所周知,有许多不同的 VBScript 可以获取您的产品密钥,其中大多数都基于注册表,因为注册表以特定方式(半加密但并非真正加密)存储您的产品密钥。

有时,注册表值会发生变化或被删除,因此在这种情况下,如果这不是限制或令人担忧,我会使用额外的第三方软件。我现在最喜欢的是产品密钥


以下是 Hackoo 的 VBScript

const HKEY_LOCAL_MACHINE = &H80000002

strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
strValueName = "DigitalProductId"
strComputer = "."
dim iValues()

Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ 
  strComputer & "\root\default:StdRegProv")
oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,iValues

Dim arrDPID
arrDPID = Array()
For i = 52 to 66
  ReDim Preserve arrDPID( UBound(arrDPID) + 1 )
  arrDPID( UBound(arrDPID) ) = iValues(i)
Next
' <--- Create an array to hold the valid characters for a microsoft Product Key --->
Dim arrChars
arrChars = Array("B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9")

' <--- The clever bit !!! (Decrypt the base24 encoded binary data) --->
For i = 24 To 0 Step -1
  k = 0
  For j = 14 To 0 Step -1
    k = k * 256 Xor arrDPID(j)
    arrDPID(j) = Int(k / 24)
    k = k Mod 24
  Next
  strProductKey = arrChars(k) & strProductKey
  ' <--- add the "-" between the groups of 5 Char --->
  If i Mod 5 = 0 And i <> 0 Then strProductKey = "-" & strProductKey
Next
strFinalKey = strProductKey

' <--- This part of the script displays operating system Information and the license Key --->
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
  & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
  ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
  strOS   = objOperatingSystem.Caption
  strBuild   = objOperatingSystem.BuildNumber
  strSerial   = objOperatingSystem.SerialNumber
  strRegistered  = objOperatingSystem.RegisteredUser
Next

Set wshShell=CreateObject("wscript.shell")
strPopupMsg = strOS & vbNewLine & vbNewLine
strPopupMsg = strPopupMsg & "Build Number:  " & strBuild & vbNewLine
strPopupMsg = strPopupMsg & "PID:  " & strSerial & vbNewLine & vbNewLine
strPopupMsg = strPopupMsg & "Registered to:  " & strRegistered & vbNewLine & vbNewLine & vbNewLine
strPopupMsg = strPopupMsg & "Your Windows Product Key is:" & vbNewLine & vbNewLine & strFinalKey
strPopupTitle = "Microsoft Windows License Information"
wshShell.Popup strPopupMsg,,strPopupTitle,vbCancelOnly+vbinformation

另一个有效的 VBScript

Option Explicit
Dim objshell,path,DigitalID, Result
Set objshell = CreateObject("WScript.Shell")
'Set registry key path
Path = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\"
'Registry key value
DigitalID = objshell.RegRead(Path & "DigitalProductId")
Dim ProductName,ProductID,ProductKey,ProductData
'Get ProductName, ProductID, ProductKey
ProductName = "Product Name: " & objshell.RegRead(Path & "ProductName")
ProductID = "Product ID: " & objshell.RegRead(Path & "ProductID")
ProductKey = "Installed Key: " & ConvertToKey(DigitalID)
ProductData = ProductName & vbNewLine & ProductID & vbNewLine & ProductKey
'Show messbox if save to a file
If vbYes = MsgBox(ProductData & vblf & vblf & "Save to a file?", vbYesNo + vbQuestion, "BackUp Windows Key Information") then
Save ProductData
End If
'Convert binary to chars
Function ConvertToKey(Key)
Const KeyOffset = 52
Dim isWin8, Maps, i, j, Current, KeyOutput, Last, keypart1, insert
'Check if OS is Windows 8
isWin8 = (Key(66) \ 6) And 1
Key(66) = (Key(66) And &HF7) Or ((isWin8 And 2) * 4)
i = 24
Maps = "BCDFGHJKMPQRTVWXY2346789"
Do
Current= 0
j = 14
Do
Current = Current* 256
Current = Key(j + KeyOffset) + Current
Key(j + KeyOffset) = (Current \ 24)
Current=Current Mod 24
j = j -1
Loop While j >= 0
i = i -1
KeyOutput = Mid(Maps,Current+ 1, 1) & KeyOutput
Last = Current
Loop While i >= 0

If (isWin8 = 1) Then
keypart1 = Mid(KeyOutput, 2, Last)
insert = "N"
KeyOutput = Replace(KeyOutput, keypart1, keypart1 & insert, 2, 1, 0)
If Last = 0 Then KeyOutput = insert & KeyOutput
End If
ConvertToKey = Mid(KeyOutput, 1, 5) & "-" & Mid(KeyOutput, 6, 5) & "-" & Mid(KeyOutput, 11, 5) & "-" & Mid(KeyOutput, 16, 5) & "-" & Mid(KeyOutput, 21, 5)
End Function
'Save data to a file
Function Save(Data)
Dim fso, fName, txt,objshell,UserName
Set objshell = CreateObject("wscript.shell")
'Get current user name
UserName = objshell.ExpandEnvironmentStrings("%UserName%")
'Create a text file on desktop
fName = "C:\Users\" & UserName & "\Desktop\WindowsKeyInfo.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set txt = fso.CreateTextFile(fName)
txt.Writeline Data
txt.Close
End Function

答案4

您可以使用 Belarc Advisor,可从 Belarc.com 下载。

它将为您提供计算机上软件的完整列表以及它们的许可证密钥。

相关内容