I’m looking to produce a unique ID for some embedded systems I manage. The systems are running Windows Embedded 7 Standard and .NET 4.0. The IDs must:
- Be relatively unique — each embedded system is running on the same motherboard, drive, etc. and I can’t have collisions.
- Persist across reinstalls — these computers get reimaged with new versions of our software regularly.
- Cannot rely on the disk serial number — we’re not using real disks, but rather CF cards with a CF to SATA adapter, and the CF cards are swapped out occasionally.
Also, I have multiple NICs in the machine, so relying on the on-board NIC MAC address will work only if someone can tell me how to identify which NIC is on-board vs a USB device. After further research it looks like this isn’t possible within the scope of managed code.
What’s the best way to accomplish this?
I suggest you use WMI to obtain information about the machine’s CPU, using the Win32_Processor class. Then you can construct a unique id for the machine from attributes such as
ProcessorIdandUniqueId.This way you would be using each machine’s CPU itself as the persisten “store” for the machine id.