Unique Identifier for a machine

N

Nitin

Hello,

We are trying to figure out how to get a unique identifier for a machine.
Our application is a C# windows application that talks to our server via a
webservice. Every time our webservice is called, we want to verify that the
user has a valid license. For that we want to identify the user via his/her
machine. I tried using the following

searcher = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive");

foreach(ManagementObject wmi_HD in searcher.Get())

{

HardDrive hd = new HardDrive();

hd.Model = wmi_HD["Model"].ToString();

hd.Type = wmi_HD["InterfaceType"].ToString();

hdCollection.Add(hd);

}

searcher = new ManagementObjectSearcher("SELECT * FROM
Win32_PhysicalMedia");


int i = 0;

foreach(ManagementObject wmi_HD in searcher.Get())

{

// get the hard drive from collection

// using index

HardDrive hd = (HardDrive)hdCollection;

// get the hardware serial no.

if (wmi_HD["SerialNumber"] == null)

hd.SerialNo = "None";

else

hd.SerialNo = wmi_HD["SerialNumber"].ToString();


++i;

}


In most cases, I get serial number. But in a few cases, I get serial number
for the hard drive as zero. Is there any other way to uniquely identify the
user's machine.

Thanks,
-Nitin
 
G

Gary Chang

Hi Nitin,
Is there any other way to uniquely identify the user's machine.

For your information:
DomainName+ComputerName,
NIC's MAC Address
Processor's Serial Number


Wish it helps!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
N

Nitin

Gary,

thanks for the info. However, the processor id is not available on P3 and
below and I did not find it on Windows 98 machine. Any other ideas are
welcome.

But this looks like a good starting point.

Thanks,
-Nitin
 
G

Gary Chang

Hi Nitin,

Thanks for your response!

If you have the difficulty to query the Processor Serial number, I think
the Network Adapter's MAC address should be a good choice...


Good Luck!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
N

Nitin

Thanks Gary. Unfortunately, this solution may not work as some of our
clients may not have a Network Adapter (still using Dial-up).

Is there any other option available?

Thanks,
-Nitin
 
G

Gary Chang

Hi Nitin,
Is there any other option available?

Just for your information, the IP address that the machine is currently
used and maybe you can generate a GUID for your program when the program is
installing to the customer's machine...


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
N

Nitin

I will try that. Do you know how Microsoft ensures this? If the machine does
not have network card or cannot get processor id. I am thinking of using the
serial number of operating system along with the date and time of install.
Do you think this will be unique enough?

Thanks,
-Nitin
 
G

Gary Chang

Hi Nitin,

As far as I know, the Windows' Serial Number is not unique per each
system...


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top