473,795 Members | 3,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12572
"dave m" <da***@nexcorte ch.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******** ******@TK2MSFTN GP09.phx.gbl...
"dave m" <da***@nexcorte ch.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***@nexcorte ch.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.d e/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.Nam e

--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.publi c.dotnet.langua ges.vb
Conversation: Need help finding a unique PC ID.
Subject: Re: Need help finding a unique PC ID.
"dave m" <da***@nexcorte ch.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******** ********@TK2MSF TNGP14.phx.gbl. ..
"dave m" <da***@nexcorte ch.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.d e/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.d e/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\Do mains\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_UserAccou nt where Name='Administr ator '")
Dim of searcher As ManagementObjec tSearcher = _
New ManagementObjec tSearcher(query )
Dim moc As ManagementObjec tCollection = _
searcher.Get()
Dim sid As stringer
For Each mo As ManagementObjec t 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("M achineSid").Val ue
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.d e/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************ ***********@gma il.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.d e/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/HowToProgramWit hSIDs.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_mach ine\software\mi crosoft\crytogr aphy registry key.

Ken
---------------
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:OX******** ******@TK2MSFTN GP09.phx.gbl...
"dave m" <da***@nexcorte ch.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
2304
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 tough problem for me (though i am getting closer). i have been mucking with a lot of data in a dictionary that looks like:
3
1933
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 statement on the customer table and orders table (joining on the ACCTNO) for all "Video" products. Ex: sq = "SELECT CUSTOMER.ACCTNO, CUSTOMER.NAME FROM CUSTOMER INNER JOIN ORDERS ON CUSTOMER.ACCTNO = ORDERS.ACCTNO WHERE PRODUCT_TYPE = 'Video' "...
3
1700
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 query... Basically - I have three columns in my table... product name hash, product tax code and a unique numeric record id. A product can contain one or more taxes hence this table is a
4
14428
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 query). I want to make the AutoNumber field the Primary Key: DoCmd.OpenQuery "qryXL_To" ' this is the make table query DoCmd.RunSQL "CREATE UNIQUE INDEX idxTxAcct ON tblXL_To (TxAcct_ID)" This seems to work okay, but it does not create a...
3
2710
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 examine the responsible Node's identifier to see which TreeNode triggered the event? Analyzing the Node's Text string is undesirable because it would mean performing a string compare to a set of predefined strings. This is slower and not easily...
5
8365
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
2205
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 generate unique numbers. Can anyone modify this code so that it generates or rather assigns only the unique number to the array: #include <cstdlib> #include <iostream> #include <iomanip> #include <time.h> #include <cstring>
4
10123
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 to a user, i dont really need the Unique Identifier's to be sequential so i was considering using system.time.hour + system.time.minute. + system.time.second, but am worried about daylight savings and also people altering the time on the host PC.
3
1661
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. This produces 50 rows of data. I want to give this series of results the same identical tracking number that will show up on each row in the field . This will be stored in a table, as well as being exported to Excel to be sent to a diff...
4
3123
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 ABC3 4 ABC4
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9040
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.