Page 1 of 2 12>
Topic Options
#15483 - 2001-12-21 09:01 PM Com Object for Finding Serial number
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
I was wondering if anyone knows the com object that can find the embedded serial number in the machine. The State runs a program called tangram and it takes too long to look throught all 100,000+ entries for our entries.
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#15484 - 2001-12-21 09:07 PM Re: Com Object for Finding Serial number
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Will, what flavour OS of machines ?

If Windows 2000, WMI can pull this info directly out of BIOS - check-out Radimus and Kent's WMIQuery UDF in the UDF library - else SMBIOS.EXE can be used to get at this information as well. Check-out MCA's website site for that !

-Shawn

Top
#15485 - 2001-12-26 01:54 PM Re: Com Object for Finding Serial number
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Thanks Shawn, I will look up those references and happy Boxing Day!
BTW, I am using Windows 2000 with a hint of Windows 4.0 still around
[ 26 December 2001: Message edited by: Will Hetrick ]

[ 28 December 2001: Message edited by: Will Hetrick ]

_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#15486 - 2001-12-27 03:12 AM Re: Com Object for Finding Serial number
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
Will - a caution that SMBIOS will not work on older Pentium/Pentium II-class systems. Depends upon when BIOS manufactured as to whether will return any information or not.
BIll

Top
#15487 - 2001-12-27 01:13 PM Re: Com Object for Finding Serial number
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Thanks Bleonard. That might be why Some of them can't get the info.
Shawn, do the users have to have administrator rights to query the information? It looks like all the administrators can query the info and power users can't.
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#15488 - 2001-12-27 02:35 PM Re: Com Object for Finding Serial number
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I never had that problem... it worked for everyone... as long as the machine's BIOS supported it. Serial Numbers and such sometimes are located in different places
code:

:Hardware
$Biosv="" $Biosd="" $Make="" $Model="" $SerNo="" $Case=""
$CPUfm="" $CPUsp="" $dimm1="" $dimm2="" $dimm3="" $memory=""
if @ras=0
If exist("c:\smbios.exe")=0
? " Installing SMBIOS inspector"
copy "$logon\smbios.exe" "c:\"
endif
endif
go c:
cd "c:\"
del "c:\hardware.lst"
shell "%comspec% /c c:\smbios.exe >nul"
sleep 1
$Biosv=readprofilestring("c:\hardware.lst","Bios","Version")
$biosd=readprofilestring("c:\hardware.lst","Bios","Date")
$Make =readprofilestring("c:\hardware.lst","System","Make")
$Model=readprofilestring("c:\hardware.lst","System","Model")
$SerNo=readprofilestring("c:\hardware.lst","System","Serial#")
$Case =readprofilestring("c:\hardware.lst","Case","Type")
$CPUfm=readprofilestring("c:\hardware.lst","Processor-4","Family")
$CPUsp=readprofilestring("c:\hardware.lst","Processor-4","CurSpeed")
if $CPUfm=""
$CPUfm=readprofilestring("c:\hardware.lst","Processor-400","Family")
$CPUsp=readprofilestring("c:\hardware.lst","Processor-400","CurSpeed")
endif
select
case $make="Dell Computer Corporation"
$dimm1=readprofilestring("c:\hardware.lst","MemDev4352","Size")
$dimm2=readprofilestring("c:\hardware.lst","MemDev4353","Size")
$memory=val("$dimm1")+val("$dimm2")
case $make="Compaq"
$dimm1=readprofilestring("c:\hardware.lst","MemDev35","Size")
$dimm2=readprofilestring("c:\hardware.lst","MemDev36","Size")
$dimm3=readprofilestring("c:\hardware.lst","MemDev37","Size")
$memory=val("$dimm1")+val("$dimm2")+val("$dimm3")
endselect
$freespace=getdiskspace("C:\")

? " Computer "color c+/n "Manufacturer " color w/n "is " color w+/n $Make color w/n
? " Computer "color c+/n "Model " color w/n "is " color w+/n $Model color w/n
? " Computer "color c+/n "Bios " color w/n "is " color w+/n $Biosv color w/n " dated " color w+/n $Biosd color w/n
? " Computer "color c+/n "Serial Number " color w/n "is " color w+/n $SerNo color w/n
? " Computer "color c+/n "Processor " color w/n "is a " color w+/n $CPUfm color w/n " running at " color w+/n $CPUsp color w/n
? " Computer "color c+/n "Memory " color w/n "is " color w+/n $memory " MB" color w/n
return
;********************************************* end of Hardware ***********************************************************


_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#15489 - 2001-12-28 02:40 PM Re: Com Object for Finding Serial number
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Radimus,
When I run the your code, I get blank for everything. I looked and there does not seem to be a hardware.lst file anywhere. My guess is smbios is suppoed to create this file, is that correct?
Thanks Will
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#15490 - 2001-12-28 04:52 PM Re: Com Object for Finding Serial number
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
yep

I've subsequently replaced this with the WMIQuery functions. This is more of an example of the same data in different locations...

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#15491 - 2001-12-28 09:13 PM Re: Com Object for Finding Serial number
Ashpoint Offline
Starting to like KiXtart

Registered: 1999-08-27
Posts: 192
Loc: Sydney, NSW, Australia
Hello All...

This thread looks very interesting.

I also get the same result as Will Hetrick (on my Pentium II/330). It doesn't seem as if the HARDWARE.LST file is being created (anywhere).

However, if I execute from the DOS prompt...
SMBIOS /G >c:hardware.lst
I can see heaps of (valuable) information within the C:\hardware.lst file. The file however, won't be interrogated by Radimus' Kix script.

Radimus....
Can you perhaps elaborate on your comment "I've subsequently replaced this with the WMIQuery functions"

Best regards,
Michael

[ 28 December 2001: Message edited by: Ashpoint ]

Top
#15492 - 2001-12-28 09:46 PM Re: Com Object for Finding Serial number
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Hello again,
I was just playing around with Windows WMI Object viewer and was looking at machines that do not
have the information included in the WMIQuery.
I noticed that the fields in the WMIQuery.XXX was actually blank, thus returning blank.
The funny thing is all of our computers are exactally the same make/model/speed so why would one have the info and another not have it?

Wilbur

_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#15493 - 2001-12-28 11:44 PM Re: Com Object for Finding Serial number
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
Michael check out this function WMIQuery - Used to execute a query against WMI

Will, potentially Windows security 'might' be an issue, as well as Bios version (doubtful). WMI is build into the Win2k OS, and NT SP4 or better, and WinMe. for 9x you will have to DL and install the WMI components from MSDN

there are a few different versions of SMBIOS out there. The used to use dumped it's output into a INI file structure that readprofilestring can easilly read

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#15494 - 2001-12-31 02:36 PM Re: Com Object for Finding Serial number
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Radimus,
I am using the WMI version in my login script and was wondering if you could shed some light on what is happening?
On 12/28/01 users logged in and picked up the script and when they ran the WMI script it picked up all the information, but when they ran it today, they did not pick up the information.
Can this be because they logged in to fast before the machines could get the info?
Thanks Will
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#15495 - 2001-12-31 03:23 PM Re: Com Object for Finding Serial number
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I haven't seen a machine 'skip' getting the info. I've seen the script slow down on the first WMIQuery that was ran, and then speed back up through the others.

I haven't seen it not work on one PC and work on another. As this is a function of the OS, you will need to determine that the function IS being called, and what parameters are being sent

the most likely suspect is something else in the script, perhaps a unmatched quote or a if/endif or a branching weirdness going on.

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#15496 - 2001-12-31 03:29 PM Re: Com Object for Finding Serial number
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
I have been watching the log info for the past hour, Some that have never picked up are picking upthe info, some are getting half the info and some that picked up before are not picking up the info. I peeked into the WMI of some of the computer and the information was blank in the wmi object. I am using WMI SDK object browser to look.
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#15497 - 2001-12-31 03:45 PM Re: Com Object for Finding Serial number
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
how odd...

Are these all the same machine / same bios?
Same OS / Service Pack?
what about IE?

All the machines I've run this on (Compaq Despro EN, 400 & 600, Dell Latitude CPt) are running NT SP5 w/IE 5 or Win2k SP2 IE6.
My Dev machine at home is running XP

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#15498 - 2001-12-31 03:49 PM Re: Com Object for Finding Serial number
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
We have a mix of about 5 type of machines. All are running the same version of Windows 2000 with service pack 2. The computer are Compaq EP/SB, Dell Optiplex 110, Dell Optiplex GX1, Gateway Solo laptops, and Compaq EN.
WE use Deployment Center 5.0 from Powerquest to image all the machines. So the images on these machines are the same.

BTW, all the machines are picking up the Memory size and speed of processor.
Here is an example of the login data.
Find duplicates for CINFO
Computer, Date, IP Address, Mac Address, Make, Model, Serial Num
RVBIT4-20, 12/31/2001 9:06:36 AM, 10.101.4.20, 00B0D04BB848, , ,
RVBIT4-20, 12/27/2001 8:00:27 AM, 10.101.4.20, 00B0D04BB848, Dell Computer Corporation, OptiPlex GX110, HBIT4

[ 31 December 2001: Message edited by: Will Hetrick ]

_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#15499 - 2001-12-31 04:30 PM Re: Com Object for Finding Serial number
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
then you'll want to see where there are similarities in the missing data... Not all BIOS store the data is the same place, so for those machines a different query would have to be made.

If it doesn't consistently work on the same machine... well, it IS a microsoft product

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#15500 - 2001-12-31 04:45 PM Re: Com Object for Finding Serial number
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Do you think everytime the computer starts that is requeries the information from BIOS? That is about the only thing I can think of. Sometimes is gets the info some times it doesnt.
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#15501 - 2001-12-31 08:52 PM Re: Com Object for Finding Serial number
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I don't know but I'd guess that it gets the info directly from BIOS and/or HAL, a plug and play sort of thing with the OS knowing and comminucating to the hardware and all. WMI is just a API layer to access that info.

I'd assume a new version of SMS to heavily rely on that for hardware and asset inventory.

As for your problems with the code, I really don't understand why you have these problems, perhaps the BIOS needs an update, or is is a permissions sort of thing.

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#15502 - 2001-12-31 10:04 PM Re: Com Object for Finding Serial number
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
I just can't get over that fact that a PC logged in at 8:00 am and when they rebooted at 12:00 that it would not read it again. I always get the memory size and CPu speed so I know that the scripty is working.
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.136 seconds in which 0.102 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org