This Machine Cannot Be Uniquely Identified

KB#1005: Last Updated Sep 03, 2015

Once in a blue moon, your Inedo product might suddenly stop working and give this fairly unhelpful message.

This machine cannot be uniquely identified.

It’s happened to us three times over the past two years, and a single customer in a year of use. We cannot reproduce it, but we know exactly what code is causing it: the activation module.

Like just about all software that needs to be “activated”, a “unique identifier” (UID) is generated for the computer it’s running on and validates the UID and license key against the activation code. An activation code is simply a block of data that has been “signed” with our private key and, therefore, can only be generated by our activation server.

To generate a UID, we use two pieces of information: the network card’s MAC address(es) and the processor’s serial number(s). This information is grabbed via WMI using the following code.

                string cpu = String.Empty;
                using (ManagementClass mc = new ManagementClass("Win32_Processor"))
                using (ManagementObjectCollection moc = mc.GetInstances())
                {
                    foreach (ManagementObject mo in moc)
                    {
                        cpu += mo.Properties["ProcessorId"].Value.ToString();
                        mo.Dispose();
                    }
                }

                string mac = String.Empty;
                using (ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration"))
                using (ManagementObjectCollection moc = mc.GetInstances())
                {
                    foreach (ManagementObject mo in moc)
                    {
                        if ((bool)mo["IPEnabled"]) mac += mo["MacAddress"].ToString();
                        mo.Dispose();
                    }
                }

                string uid = cpu + mac;
                if (String.IsNullOrEmpty(uid)) throw new ActivationException("This machine cannot be uniquely identified.");

In theory, uid should never be null or empty. Even if the ProcessorId is unreadable (perhaps the CPU doesn’t support it, or it’s disabled in BIOS), there should always be at least one MAC address. Our products are after all web applications.

In practice, WMI will occasionally “stop working” and return null for both ProcessorId and MacAddress. We believe the solution to this is to restart the winmgmt service. And I say “believe” because every time this has happened, we just simply rebooted the server and the problem went away.

If you happen to be “lucky” and come across this same message, try stopping/starting the winmgmt service. We’re very eager to know if that will fix it; if so, we can simply add a page that does that for you (or, at the very least, instructions) .