Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Uniquely identify x86 windows machines ?

Reply
Thread Tools Display Modes

Uniquely identify x86 windows machines ?

 
 
Vilius Mockūnas
Guest
Posts: n/a

 
      09-21-2009

Hello,

How do I uniquely identify x86 windows machines using vbscript ?
OS'es are XP or Vista.
Id should be the same even os version changes (or windows are reinstalled
with other product id).
I've used computer names before that and realized that this is mistake
because computer names are beeing changed, computers are beeing joined and
unjoined from domain and etc.

Maybe there is some hardware id or something, which looks the same even os
was reinstalled ?

thanks
Vuilius


 
Reply With Quote
 
 
 
 
Pegasus [MVP]
Guest
Posts: n/a

 
      09-21-2009

"Vilius Mockūnas" <> wrote in message
news:%...
> Hello,
>
> How do I uniquely identify x86 windows machines using vbscript ?
> OS'es are XP or Vista.
> Id should be the same even os version changes (or windows are reinstalled
> with other product id).
> I've used computer names before that and realized that this is mistake
> because computer names are beeing changed, computers are beeing joined and
> unjoined from domain and etc.
>
> Maybe there is some hardware id or something, which looks the same even os
> was reinstalled ?
>
> thanks
> Vuilius


You could use the BIOS serial number:

strComputer = "Nalle"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_BIOS",,48)
For Each objItem in colItems
Wscript.Echo "BIOS Serial Number: " & objItem.SerialNumber
Next


 
Reply With Quote
 
Vilius Mockūnas
Guest
Posts: n/a

 
      09-21-2009

Anoher guy suggested Win32_BaseBoard class SerialNumber property.
Which one is better to use ?

thanks
Vilius

"Pegasus [MVP]" <> wrote in message
news:Ot$...
>
> "Vilius Mockūnas" <> wrote in message
> news:%...
>> Hello,
>>
>> How do I uniquely identify x86 windows machines using vbscript ?
>> OS'es are XP or Vista.
>> Id should be the same even os version changes (or windows are reinstalled
>> with other product id).
>> I've used computer names before that and realized that this is mistake
>> because computer names are beeing changed, computers are beeing joined
>> and unjoined from domain and etc.
>>
>> Maybe there is some hardware id or something, which looks the same even
>> os was reinstalled ?
>>
>> thanks
>> Vuilius

>
> You could use the BIOS serial number:
>
> strComputer = "Nalle"
> Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
> Set colItems = objWMIService.ExecQuery( _
> "SELECT * FROM Win32_BIOS",,48)
> For Each objItem in colItems
> Wscript.Echo "BIOS Serial Number: " & objItem.SerialNumber
> Next
>



 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a

 
      09-21-2009
It's a matter of preference.

"Vilius Mockūnas" <> wrote in message
news:...
> Anoher guy suggested Win32_BaseBoard class SerialNumber property.
> Which one is better to use ?
>
> thanks
> Vilius
>
> "Pegasus [MVP]" <> wrote in message
> news:Ot$...
>>
>> "Vilius Mockūnas" <> wrote in message
>> news:%...
>>> Hello,
>>>
>>> How do I uniquely identify x86 windows machines using vbscript ?
>>> OS'es are XP or Vista.
>>> Id should be the same even os version changes (or windows are
>>> reinstalled with other product id).
>>> I've used computer names before that and realized that this is mistake
>>> because computer names are beeing changed, computers are beeing joined
>>> and unjoined from domain and etc.
>>>
>>> Maybe there is some hardware id or something, which looks the same even
>>> os was reinstalled ?
>>>
>>> thanks
>>> Vuilius

>>
>> You could use the BIOS serial number:
>>
>> strComputer = "Nalle"
>> Set objWMIService = GetObject("winmgmts:\\" & strComputer &
>> "\root\CIMV2")
>> Set colItems = objWMIService.ExecQuery( _
>> "SELECT * FROM Win32_BIOS",,48)
>> For Each objItem in colItems
>> Wscript.Echo "BIOS Serial Number: " & objItem.SerialNumber
>> Next
>>

>
>



 
Reply With Quote
 
Vilius Mockūnas
Guest
Posts: n/a

 
      09-21-2009
I've just checked Win32_BaseBoard class SerialNumber property - and its
empty - the box is lenovo think centre. So only Win32_BIOS serialnumber
left - you are sure that this is unique across all computers of the same
order ? Or maybe I should concatenate with something else to be sure ?

V


"Pegasus [MVP]" <> wrote in message
news:...
> It's a matter of preference.
>
> "Vilius Mockūnas" <> wrote in message
> news:...
>> Anoher guy suggested Win32_BaseBoard class SerialNumber property.
>> Which one is better to use ?
>>
>> thanks
>> Vilius
>>
>> "Pegasus [MVP]" <> wrote in message
>> news:Ot$...
>>>
>>> "Vilius Mockūnas" <> wrote in message
>>> news:%...
>>>> Hello,
>>>>
>>>> How do I uniquely identify x86 windows machines using vbscript ?
>>>> OS'es are XP or Vista.
>>>> Id should be the same even os version changes (or windows are
>>>> reinstalled with other product id).
>>>> I've used computer names before that and realized that this is mistake
>>>> because computer names are beeing changed, computers are beeing joined
>>>> and unjoined from domain and etc.
>>>>
>>>> Maybe there is some hardware id or something, which looks the same even
>>>> os was reinstalled ?
>>>>
>>>> thanks
>>>> Vuilius
>>>
>>> You could use the BIOS serial number:
>>>
>>> strComputer = "Nalle"
>>> Set objWMIService = GetObject("winmgmts:\\" & strComputer &
>>> "\root\CIMV2")
>>> Set colItems = objWMIService.ExecQuery( _
>>> "SELECT * FROM Win32_BIOS",,48)
>>> For Each objItem in colItems
>>> Wscript.Echo "BIOS Serial Number: " & objItem.SerialNumber
>>> Next
>>>

>>
>>

>
>



 
Reply With Quote
 
Pegasus [MVP]
Guest
Posts: n/a

 
      09-21-2009

"Vilius Mockūnas" <> wrote in message
news:...
> I've just checked Win32_BaseBoard class SerialNumber property - and its
> empty - the box is lenovo think centre. So only Win32_BIOS serialnumber
> left - you are sure that this is unique across all computers of the same
> order ? Or maybe I should concatenate with something else to be sure ?
>
> V


I have never had reason to use this method, so I can't be sure. Common sense
says that each manufacturer uses unique serial numbers, so I would expect
the concatenated string generated by the code below to be unique across all
computers.

strComputer = "Nalle"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_BIOS",,48)
For Each objItem in colItems
Wscript.Echo objItem.SerialNumber, "-", objItem.Name
Next


 
Reply With Quote
 
Richard Mueller [MVP]
Guest
Posts: n/a

 
      09-21-2009
Be sure to test. I have many computers where the Win32_BIOS class returns a
blank string. Probably older computers (Windows 2000), but one has XP. I
have used the Win32_LogicalDisk class to retrieve the volume serial number.
This uniquely identifies the logical disk, but will change if the drive is
replaced (or FDisk'd). For example:
=============
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,authenticationLev el=Pkt}!\\" _
& strComputer & "\root\cimv2")

Set colSettings = objRemote.ExecQuery _
("SELECT * FROM Win32_LogicalDisk WHERE Name = 'C:'")
For Each objDisk In colSettings
Wscript.Echo objDisk.VolumeSerialNumber
Next
=========
As noted, this is not a perfect solution, but it was the best I found that
worked on all computers (if they supported WMI and had a C: drive). Other
people have used OS serial number, but of course the OS can be re-installed.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--

"Vilius Mockūnas" <> wrote in message
news:...
> I've just checked Win32_BaseBoard class SerialNumber property - and its
> empty - the box is lenovo think centre. So only Win32_BIOS serialnumber
> left - you are sure that this is unique across all computers of the same
> order ? Or maybe I should concatenate with something else to be sure ?
>
> V
>
>
> "Pegasus [MVP]" <> wrote in message
> news:...
>> It's a matter of preference.
>>
>> "Vilius Mockūnas" <> wrote in message
>> news:...
>>> Anoher guy suggested Win32_BaseBoard class SerialNumber property.
>>> Which one is better to use ?
>>>
>>> thanks
>>> Vilius
>>>
>>> "Pegasus [MVP]" <> wrote in message
>>> news:Ot$...
>>>>
>>>> "Vilius Mockūnas" <> wrote in message
>>>> news:%...
>>>>> Hello,
>>>>>
>>>>> How do I uniquely identify x86 windows machines using vbscript ?
>>>>> OS'es are XP or Vista.
>>>>> Id should be the same even os version changes (or windows are
>>>>> reinstalled with other product id).
>>>>> I've used computer names before that and realized that this is mistake
>>>>> because computer names are beeing changed, computers are beeing joined
>>>>> and unjoined from domain and etc.
>>>>>
>>>>> Maybe there is some hardware id or something, which looks the same
>>>>> even os was reinstalled ?
>>>>>
>>>>> thanks
>>>>> Vuilius
>>>>
>>>> You could use the BIOS serial number:
>>>>
>>>> strComputer = "Nalle"
>>>> Set objWMIService = GetObject("winmgmts:\\" & strComputer &
>>>> "\root\CIMV2")
>>>> Set colItems = objWMIService.ExecQuery( _
>>>> "SELECT * FROM Win32_BIOS",,48)
>>>> For Each objItem in colItems
>>>> Wscript.Echo "BIOS Serial Number: " & objItem.SerialNumber
>>>> Next
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Besides Windows machines, what other machines can join Windows 2003 Active Directory domain? Spin Active Directory 4 08-23-2008 12:43 AM
Re: How can a multihomed external ISP created DHCP Address be uniquely registered on an internal DNS Server? Ace Fekay [MVP] DNS Server 1 07-17-2006 12:41 AM
How to uniquely identify a UDP session at Winsock layer? ganesan Windows Vista Drivers 4 05-13-2005 06:13 PM
How to identify non-windows clients David Scripting 3 05-20-2004 03:25 PM
Media Player 9 series - unable to uniquely identify Rob McSherry Windows Media Player 1 09-01-2003 06:06 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59