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

MMM*_*MMM 23 license windows-10

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

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

Bra*_*oij 32

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

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

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

  • 我认为,Office 密钥是 2010 年,但不是更高版本(不会将其密钥完整存储在注册表中)。对于这些,您可以使用 ospp.vbs 获取密钥的最后五位数字,该文件安装在 C:\Program Files (x86)\Microsoft Office\Office16 Substitute 15、14 等中,用于较早版本的 Office。2019 和 365 都在 16 岁以下。那是针对 32 位 Office。对于 64 位,用 Program Files 替换 Program Files (x86) (3认同)
  • 网上有几篇关于 ospp 的不错的文章,或者让人们参考 VBS 所在目录中的 ospp.html 文件。它列出了许多其他有趣的命令行参数。顺便说一句,我在最近更新的带有 Office 365 的 Win10 VM 中尝试了 ProduKey,但它找不到 *任一 * 键。因此,正如他们所说,我们的里程可能会有所不同。但是 nirsoft 实用程序快速且易于尝试;非常值得一试。 (3认同)
  • @BramMooij 谢谢,这似乎也适用于其他机器! (2认同)

Vir*_*ity 15

进入:

wmic path softwareLicensingService get OA3xOriginalProductKey 
Run Code Online (Sandbox Code Playgroud)

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

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

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

  • @MMM - 此答案建议的命令仅适用于 OEM 密钥。如果该命令不返回任何内容,则表示您没有在带有 OEM 密钥的机器上运行它。事实上,到目前为止您收到的每个答案都只适用于 OEM 密钥。 (4认同)
  • 使用管理命令提示符。它在这里返回了密钥。 (2认同)

小智 6

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

wmic path softwareLicensingService get OA3xOriginalProductKey
Run Code Online (Sandbox Code Playgroud)

或在管理员 Powershell 中

$(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey
Run Code Online (Sandbox Code Playgroud)

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

有时,注册表值会更改或被删除,因此在这种情况下,如果这不是限制或问题,我会使用额外的第三方软件。我现在最喜欢的是ProduKey


下面是 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
Run Code Online (Sandbox Code Playgroud)

另一个可以运行的 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
Run Code Online (Sandbox Code Playgroud)

  • 这个答案是已有答案的组合。我可以问一下,为什么您发布的答案似乎没有为现有答案添加任何内容?或者我错过了什么? (6认同)

归档时间:

查看次数:

6477 次

最近记录:

4 年,6 月 前