473,415 Members | 1,519 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,415 software developers and data experts.

Need help finding a unique PC ID.

I need to be able to retrieve a unique ID from a users PC. I needs to be
something a user could not easily change, like the computer name. Could
someone point me in the right direction to find the information found in
Windows system information? Or maybe there is a better method.

Thanks in advance for any help or suggestions.

Dave M.
Nov 23 '05 #1
9 12548
"dave m" <da***@nexcortech.com> schrieb:
I need to be able to retrieve a unique ID from a users PC. I needs to be
something a user could not easily change, like the computer name. Could
someone point me in the right direction to find the information found in
Windows system information? Or maybe there is a better method.


There is not a single unique ID. Some CPUs have an ID, other machines which
have a network card have a (hopefully) unique MAC ID, ...

I am curious why you would want to determine a unique ID. Maybe there is a
better solution.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #2
Thanks for the reply! I'd like to have a method tell how many PCs at a
site are running a particular application of ours. My thinking would be to
store this unique ID in a database on a server that these networked PCs
connect to. Then I could tell how many seats are using the application,
When they are using it, and for how long.

Dave M.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OX**************@TK2MSFTNGP09.phx.gbl...
"dave m" <da***@nexcortech.com> schrieb:
I need to be able to retrieve a unique ID from a users PC. I needs to be
something a user could not easily change, like the computer name. Could
someone point me in the right direction to find the information found in
Windows system information? Or maybe there is a better method.


There is not a single unique ID. Some CPUs have an ID, other machines
which have a network card have a (hopefully) unique MAC ID, ...

I am curious why you would want to determine a unique ID. Maybe there is
a better solution.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #3
"dave m" <da***@nexcortech.com> schrieb:
I'd like to have a method tell how many PCs at a site are running a
particular application of ours. My thinking would be to store this
unique ID in a database on a server that these networked PCs connect to.


If your application is used in-house, then you can maybe utilize the MAC ID
of the machines' network cards:

<URL:http://groups.google.de/groups?q=mac+id+dotnet>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #4
Herfried is right; there's really isn't a good "unique" identifier for a machine. In the recent past, the industry wanted to add some unique identifiers to CPUs, but privacy issues led to a reconsideration of that plan. (Thus I second Herfried's comments -- maybe there's a better solution for what you're trying to do.)

Incidentally, getting the machine name is simple enough when using the newly released VS2005 (which you can check out for free, in Express Edition form, from http://msdn.microsoft.com/vstudio/express) -- something like the following would work:

Dim s as string = My.Computer.Name

--Matt Gertz--*
VB Compiler Dev Lead

-----Original Message-----
From: Herfried K. Wagner [MVP]
Posted At: Monday, November 14, 2005 12:16 PM
Posted To: microsoft.public.dotnet.languages.vb
Conversation: Need help finding a unique PC ID.
Subject: Re: Need help finding a unique PC ID.
"dave m" <da***@nexcortech.com> schrieb:
I need to be able to retrieve a unique ID from a users PC. I needs to be
something a user could not easily change, like the computer name. Could
someone point me in the right direction to find the information found in
Windows system information? Or maybe there is a better method.


There is not a single unique ID. Some CPUs have an ID, other machines which
have a network card have a (hopefully) unique MAC ID, ...

I am curious why you would want to determine a unique ID. Maybe there is a
better solution.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 23 '05 #5
Great, I think I've got enough info to get started.

Thanks again,

Dave M.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
"dave m" <da***@nexcortech.com> schrieb:
I'd like to have a method tell how many PCs at a site are running a
particular application of ours. My thinking would be to store this
unique ID in a database on a server that these networked PCs connect to.


If your application is used in-house, then you can maybe utilize the MAC
ID of the machines' network cards:

<URL:http://groups.google.de/groups?q=mac+id+dotnet>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #6
Hi Herfried!

Herfried K. Wagner [MVP] wrote:
I'd like to have a method tell how many PCs at a site are running a
particular application of ours. My thinking would be to store this
unique ID in a database on a server that these networked PCs connect
to.


If your application is used in-house, then you can maybe utilize the
MAC ID of the machines' network cards:

<URL:http://groups.google.de/groups?q=mac+id+dotnet>


Should the machine SID not be unique as well? I'm not 100% sure but I think
so.

Getting the machine SID in VB.NET:
http://groups.google.de/group/micros...fd79f4560ddc1b

(In german, just have a look at the code)

Cheers

Arne Janning

Nov 23 '05 #7
Here is the babelfish translation for that page

Hello Davide!

"Davide De Santis" wrote in the news contribution
I wanted to ask, whether and how it is possible in VB.NET the SID one
operating system to select (those, which one changes with the Clonen by means of Sysprep should).
According to Marks of Russiovic
http://www.sysinternals.com/ntw2k/source/newsid.shtml

the Machine SID is in the RegistryKey
SECURITY\SAM\Domains\Account

This key has a binary value V and the last 96 bits contained that
Key.

To this key you come however only, if your program under that
System account runs. That is thus no passable way. Into regedit.exe see
You the key also only, if you regedit.exe under the system account
, small trick starts: start a command line and tap then

RK < time > /interactive regedit

, thus for example

RK 19:20 /interactive regedit

Then starts around 19:20 under the system account and you see that regedit
Key also.

You know however the program PsGetSid
http://www.sysinternals.com/ntw2k/fr...psgetsid.shtml

use and the output parsen, similar to for instance for the last example
here:
http://groups.google.de/groups?selm=...TK2MSFTNGP12.p...

Or in addition, this code use:

' reference on system management DLL set!
Import system management

Private Function GetMachineSid() As stringer
Dim query As ObjectQuery = _
New ObjectQuery(_
"SELECT * from Win32_UserAccount where Name='Administrator '")
Dim of searcher As ManagementObjectSearcher = _
New ManagementObjectSearcher(query)
Dim moc As ManagementObjectCollection = _
searcher.Get()
Dim sid As stringer
For Each mo As ManagementObject in moc
sid = mo("sid")
NEXT one

Dim pattern As stringer = _
"(?<MachineSid>\w-\d-\d-\d{2}-\d{10}-\d{10}-\d{10})"
Dim move As Regex = new Regex(pattern)
Dim mc As MatchCollection = reg.Matches(sid)
Return mc(0).Groups("MachineSid").Value
End to Function

This code gets itself the SID of the administrator and uses the Pattern,
over
to filter the Machine SID, those in the user SID of the administrator
is always contained. I hope that I described the Pattern correctly
, on that me accessible computers it has perfectly functioned.

Details to SIDs by the way give it in the outstanding book

The NET Developer's Guide ton of Windows Security
By Keith Brown

Publisher: Addison Wesley
Pub DATE: Septembers 27, 2004
ISBN: 0-321-22835-9
Pages: 408

http://www.awprofessional.com/title/0321228359

Greeting

Arne Janning

Arne Janning wrote: Hi Herfried!

Herfried K. Wagner [MVP] wrote:
I'd like to have a method tell how many PCs at a site are running a
particular application of ours. My thinking would be to store this
unique ID in a database on a server that these networked PCs connect
to.


If your application is used in-house, then you can maybe utilize the
MAC ID of the machines' network cards:

<URL:http://groups.google.de/groups?q=mac+id+dotnet>

Should the machine SID not be unique as well? I'm not 100% sure but I think
so.

Getting the machine SID in VB.NET:
http://groups.google.de/group/micros...fd79f4560ddc1b

(In german, just have a look at the code)

Cheers

Arne Janning


--

Kind Regards

David Huisman
General Manager
-----------------------------------------------------------------------
ORBIT COMMUNICATIONS Pty Ltd - Wireless Solutions that Work
(Telemetry, Control, Monitoring, Security, HVAC ...)
A.C.N. 107 441 869
Website : http://www.orbitcoms.com
PO Box 4474 Lakehaven
NSW 2263, AUSTRALIA
Phone: 61-2-4393-3627
Fax : 61-2-4393-3685
Mobile: 61-413-715-986
Nov 23 '05 #8
Arne,

"Arne Janning" <sp***********************@gmail.com> schrieb:
I'd like to have a method tell how many PCs at a site are running a
particular application of ours. My thinking would be to store this
unique ID in a database on a server that these networked PCs connect
to.


If your application is used in-house, then you can maybe utilize the
MAC ID of the machines' network cards:

<URL:http://groups.google.de/groups?q=mac+id+dotnet>


Should the machine SID not be unique as well? I'm not 100% sure but I
think so.


Yes, SIDs are AFAIK globally unique too.

BTW: At least parts of Keith Brown's book are available online:

What Is A SID?
<URL:http://pluralsight.com/wiki/default.aspx/Keith.GuideBook/WhatIsASID.html>

Determining the SID using .NET Framework 2.0:

How To Program With SIDs
<URL:http://pluralsight.com/wiki/default.aspx/Keith.GuideBook/HowToProgramWithSIDs.html>

IIRC SIDs are only supported on NT-based operating systems, so using them as
unique identifiers will not work if machines running Windows 98 or Windows
Me are used.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #9
Hi,

In the registry there also is a machine guid key in the
hkey_local_machine\software\microsoft\crytography registry key.

Ken
---------------
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OX**************@TK2MSFTNGP09.phx.gbl...
"dave m" <da***@nexcortech.com> schrieb:
I need to be able to retrieve a unique ID from a users PC. I needs to be
something a user could not easily change, like the computer name. Could
someone point me in the right direction to find the information found in
Windows system information? Or maybe there is a better method.


There is not a single unique ID. Some CPUs have an ID, other machines
which have a network card have a (hopefully) unique MAC ID, ...

I am curious why you would want to determine a unique ID. Maybe there is
a better solution.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kevin parks | last post by:
hi. I've been banging my head against this one a while and have asked around, and i am throwing this one out there in the hopes that some one can shed some light on what has turned out to be a...
3
by: David Berry | last post by:
Hi All. I'm trying to write an ASP page that shows me the UNIQUE account number for a customer (so I can pass it to another page) based on a search criteria. For example, I want to do a select...
3
by: Randell D. | last post by:
Folks, My internet access is intermitent until I get my own connection inside the next ten days - I say this so that I can thank in advance who ever gives a few seconds to read/answer my...
4
by: deko | last post by:
I have a Make Table query that creates a fairly large table. The Make Table query populates the new table with one AutoNumber field (which is taken form another unrelated table as part of the...
3
by: Kilroy Programmer | last post by:
Is there a way to store a unique numeric identifier (say, for example, an int) into a TreeNode, so that when the TreeNode is checked (since CheckBoxes is enabled) the eventhandler AfterCheck() can...
5
by: David Pope | last post by:
I need to create a unique number like a GUID but all numbers. Does anyone know of algorithm to do this? Thanks, David
3
by: ronnchpra | last post by:
Hello, I need help generating 50 unique numbers using rand() BETWEEN 1 and 100 and assign them to a array. I have worked out the number randomization and assignment, but I cant figure out how to...
4
by: ba.hons | last post by:
Hello all, Was wondering if anyone could provide some info on what could be a possible solution to a problem am having. I have to generate a Unique Identifier in C# which I will use to assign...
3
by: perryclisbee via AccessMonster.com | last post by:
I have a query where I need all of the results to be assigned a single tracking number. Example: I run the query for all claims within a certain date parameter, for 10 different patient codes. ...
4
by: jameswilkinsonfjs | last post by:
Hi All, Ok I have a table - it lists items with a unique reference code; lets say there are 4 items : Item RefCode 1 ABC1 2 ABC2 3 ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.