I'm trying to create a unique id for the system using VBA macros, but it's returning blank values from a few computers. The unique id system takes into account the following parameters: 'GetMotherBoardProp,' 'ComputerName,' 'GetDDSerialNumber,' 'GetBIOSProperties,' 'CPUID,' and hashes it with md5
Public Function MD5Hex(textString As String) As String
On Error GoTo HashError
Dim Enc
Dim textBytes() As Byte
Dim bytes
Dim outstr As String
Dim pos
Set Enc = CreateObject("System.Security.Cryptography.MD5CryptoServiceProvider")
textBytes = textString
bytes = Enc.ComputeHash_2((textBytes))
For pos = 1 To LenB(bytes)
outstr = outstr & LCase(Right("0" & Hex(AscB(MidB(bytes, pos, 1))), 2))
Next
MD5Hex = outstr
Set Enc = Nothing
Exit Function
HashError:
SendToLogFile "Error while executing 5th Module"
SendToLogFile Err.Number & vbTab & Err.Description
MsgBox "Error while displaying Info Keys", vbCritical, JT
End Function
For getting bios properties used this code from Devhut
Edit:1 These hashes will be saved in my Google spreadsheet. and here are the responses for the few: Systems Responses Help me to solve this problem