tags:

views:

123

answers:

1

I am currently using WMI to query various details about the underlying hardware in order to uniquely identify a machine. To this end, I came across a field called "Signature" under "Win32_DiskDrive". Is this signature unique across machines (globally)? Can this be used reliably to identify the machine?

Thanks, Ananth

+1  A: 

In my experience, it is not always, but may be often enough for your purposes.

My company makes software that, among other things, generates VMs from physical machines. One of the problems we had to solve when doing this was how to preserve the disk signature, since the signature is used by Windows to identify the disk. It is possible to create another disk with the same signature if you know where the signature is stored in the master boot record.

So the answer is it depends. If you assume the signature uniquely identifies the machine, and you run into a situation where someone has cloned a disk or otherwise obtained a duplicate signature, how will your app respond? How serious a problem would that be? If the answer is 'not that serious' maybe it's good enough for your purposes.

You might also consider the MAC address on the machine's Ethernet card. This is (more or less) guaranteed to be unique, and if it's not they have other problems (like ARP resolution issues).

anelson
Thanks. So, if I understand, the chances of the Signature being unique is high, but the application should still be able to handle the edge cases where they are not unique as well.Regarding MAC address, please see a comment from Johannes Rossel in http://stackoverflow.com/questions/2154722/algorithm-to-generate-unique-possibly-auto-incremented-ids that mentions that there are user-configurable MAC addresses as well in NICs.
Ananth
That's it exactly.As for MAC addresses, that's the "or less" part of "more or less" :) The reason I think MAC address is a better bet is that I think it's more likely to be unique, simply because if two cards on the same LAN segment have the same MAC address, Bad Things will happen, while two machines with the same disk signature will happily coexist. Thus, duplicate MAC addresses are more likely to be noticed and resolved than are duplicate disk signatures.In either case, though, your app should handle the edge cases appropriately.
anelson