Search code examples
javawindowsunique

Retrieve a unique permanent machine(Laptop/Computer) ID using java


I have developed a software in JAVA in which I need to register user machine in my database.

Each user machine must be unique, if user login from another machine it should be detected.

For this I have use wmic commands to get ProcessorId and Baseboard SerialNumber.

I am appending baseboard serial number to processorId for more uniqueness. But the problem is I am getting same ProcessorId+SerialNumber for 2 different machines.
For Eg : Machine 1 = abcd-123
Machine 2 = abcd-123

Also Baseboard serial number giving output like "N/A", "Unknown", "To be field by O.E.M".

I have thought of wmic csproduct get UUID which gives Mother board UUID,
but I am afraid of duplicity of the same, as many user has been already registered their machines and using the software.

Situation
User-1 already registered with machine text abcd-123 (processorId-basebord Sr No)
Now User-2 login to the system for very first time with different machine having the same machine text i.e abcd-123
At the time of machine validation at server, User-2's machine shown as already registered so User-2 cannot proceed.

Please help me solving the problem.


Solution

  • For this I used user machine uuid by using wmic command.
    wmic csproduct get uuid
    This is unique for every motherboard.
    IF UUID not available I used processorId + MobileNo

    CURRENTLY THIS SOLVED MY PROBLEM.