Create a unique identification string for a PC
Submitted by itefix on Tue, 12/08/2008 - 16:40
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")))
EndFunc
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
ExitLoop
EndIf
Next
Return $id
EndFunc
Release news
-
2023-03-21
-
2023-03-20
-
2023-03-20
-
2023-03-10
-
2023-03-09
-
2023-03-04
-
2023-03-02
-
2023-02-28
-
2023-03-07