MachineGuid is an identifier that is stored in the registry and generated during the installation of Windows. This tutorial provides 2 methods how to get MachineGuid from registry on Windows.
Note that the MachineGuid would be the same on multiple machines if a machine is restored from a backup or clone.
Method 1 - CMD
The reg query
command can be used for retrieving values by key from registry. To get MachineGuid
as sole output, combine reg query
command with for
loop:
for /f "skip=2 tokens=3" %a in ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography /v MachineGuid') do @echo %a
Method 2 - PowerShell
To get MachineGuid in PowerShell, use the Get-ItemProperty
command:
(Get-ItemProperty Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography).MachineGUID
Leave a Comment
Cancel reply