Create a unique identification string for a PC

If you need to identify a PC in a unique way for security purposes, you can create a fingerprint consisting of various identification tags of the components in the PC. The Autoit script below returns an MD5 digest for the combination of computer name, chassis id, baseboard id and disk id of drive C:



#include <MD5.au3>
Func Fingerprint()
Return StringUpper(md5(@ComputerName & "__" & GetId("chassis") & "__" & GetId("baseboard") & "__" & GetId("disk")))
Func GetId($component)
 If ($component = 'disk') Then return DriveGetSerial( "c:\" )
 Dim $strComputer = "."
 Dim $objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
 Dim $query = ""
 If $component = 'chassis' Then $query = "Select * from Win32_SystemEnclosure"
 If $component = 'baseboard' Then $query = "select * from Win32_BaseBoard"
 Dim $query_result = $objWMIService.ExecQuery ($query)
 Dim $id = ""
 For $obj in $query_result
  If $obj.SerialNumber <> "" Then
   $id = $obj.SerialNumber
 Return $id 


Release news