![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Uniquely identify x86 windows machines ? 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 |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Uniquely identify x86 windows machines ? "Vilius Mockûnas" <v_mockunas@newsgroup> wrote in message news:%23C0RRSpOKHA.5488@newsgroup Quote: > 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 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 |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Uniquely identify x86 windows machines ? Anoher guy suggested Win32_BaseBoard class SerialNumber property. Which one is better to use ? thanks Vilius "Pegasus [MVP]" <news@newsgroup> wrote in message news:Ot$FTdrOKHA.3992@newsgroup Quote: > > "Vilius Mockûnas" <v_mockunas@newsgroup> wrote in message > news:%23C0RRSpOKHA.5488@newsgroup Quote: >> 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 > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Uniquely identify x86 windows machines ? It's a matter of preference. "Vilius Mockûnas" <v_mockunas@newsgroup> wrote in message news:uhkW39sOKHA.1876@newsgroup Quote: > Anoher guy suggested Win32_BaseBoard class SerialNumber property. > Which one is better to use ? > > thanks > Vilius > > "Pegasus [MVP]" <news@newsgroup> wrote in message > news:Ot$FTdrOKHA.3992@newsgroup Quote: >> >> "Vilius Mockûnas" <v_mockunas@newsgroup> wrote in message >> news:%23C0RRSpOKHA.5488@newsgroup Quote: >>> 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 >> > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Uniquely identify x86 windows machines ? 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]" <news@newsgroup> wrote in message news:uaLi6AtOKHA.4964@newsgroup Quote: > It's a matter of preference. > > "Vilius Mockûnas" <v_mockunas@newsgroup> wrote in message > news:uhkW39sOKHA.1876@newsgroup Quote: >> Anoher guy suggested Win32_BaseBoard class SerialNumber property. >> Which one is better to use ? >> >> thanks >> Vilius >> >> "Pegasus [MVP]" <news@newsgroup> wrote in message >> news:Ot$FTdrOKHA.3992@newsgroup Quote: >>> >>> "Vilius Mockûnas" <v_mockunas@newsgroup> wrote in message >>> news:%23C0RRSpOKHA.5488@newsgroup >>>> 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 >>> >> > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Uniquely identify x86 windows machines ? "Vilius Mockûnas" <v_mockunas@newsgroup> wrote in message news:ePkFkbtOKHA.1876@newsgroup Quote: > 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 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 |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Uniquely identify x86 windows machines ? 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,authenticationLevel=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" <v_mockunas@newsgroup> wrote in message news:ePkFkbtOKHA.1876@newsgroup Quote: > 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]" <news@newsgroup> wrote in message > news:uaLi6AtOKHA.4964@newsgroup Quote: >> It's a matter of preference. >> >> "Vilius Mockûnas" <v_mockunas@newsgroup> wrote in message >> news:uhkW39sOKHA.1876@newsgroup Quote: >>> Anoher guy suggested Win32_BaseBoard class SerialNumber property. >>> Which one is better to use ? >>> >>> thanks >>> Vilius >>> >>> "Pegasus [MVP]" <news@newsgroup> wrote in message >>> news:Ot$FTdrOKHA.3992@newsgroup >>>> >>>> "Vilius Mockûnas" <v_mockunas@newsgroup> wrote in message >>>> news:%23C0RRSpOKHA.5488@newsgroup >>>>> 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 >>>> >>> >>> >> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Network won't identify correct machines | Network & Sharing | |||
| Windows identify it as a sign of failing to shutdown safely !? | Vista General | |||
| How to identify bit version of Windows Vista | Vista General | |||
| Windows Security Center does not identify AntiVirus | Vista security | |||
| I can see my XP machines, and my XP machines can see my Vista Mach | Vista networking & sharing | |||