Re: wim32 class?
- From: "Linn Kubler" <lkubler@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Aug 2008 11:20:37 -0500
First of all, thanks for responding to my question everyone. I delved into
this and stall am having no luck. The SystemChasis and Bios classes do have
a serial number field but I'm not sure what serial number it contains,
doesn't match my system serial number.
I contacted HP tech support and before they gave me the boot, telling me I
had to pay for their services, they let slip that the serial number is
stored in the bios. So I booted up one of my computers here and checked and
sure enough, it's listed right in the bios under system information.
Question now is, how do I read the bios information? The wim32_bios class
doesn't give me anything like this so how do I do it? So far I haven't had
any luck with google or the scripting center.
Thanks again,
Linn
"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx> wrote in
message news:%23L3HYixBJHA.3200@xxxxxxxxxxxxxxxxxxxxxxx
"Linn Kubler" <lkubler@xxxxxxxxxxxxxxxxxx> wrote in message
news:uPcdNpuBJHA.1012@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
Is there is a win32 class that returns the serial number of the computer?
I'm writing some scripts to remotely determine the components of a
computer in my network and see the win32_computersystem class returns the
manufacturer and model of the computer but I don't see a property for
serial number. I know it would be up to the manufacturer to enter the
data but figured if it at least existed I could populate it myself if
necessary. I've been looking through the classes but can't seem to locate
anything so far.
I'm working with Windows XP mostly but suspect I'll be forced to move to
Vista sometime in the near future.
Thanks in advance,
Linn
Experience may vary, but I find that the SerialNumber property of the
Win32_SystemEnclosure and Win32_BIOS classes is supported in Vista and
Windows Server 2003 and above. On XP and Windows 2000 clients the values
are not populated. However, you can retrieve a VolumeSerialNumber from the
Win32_LogicalDisk class on all clients with WMI installed. For example:
=========
Option Explicit
Dim strComputer, objWMIService, colItems, objItem
strComputer = InputBox("Enter local computer name", "S/N")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
& strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("SELECT * FROM Win32_SystemEnclosure")
For Each objItem In colItems
Wscript.Echo "System S/N: " & objItem.SerialNumber
Next
Set colItems = objWMIService.ExecQuery _
("SELECT * FROM Win32_BIOS")
For Each objItem In colItems
Wscript.Echo "BIOS S/N: " & objItem.SerialNumber
Next
Set colItems = objWMIService.ExecQuery _
("SELECT * FROM Win32_LogicalDisk WHERE Name='C:'")
For Each objItem In colItems
Wscript.Echo "Volume S/N: " & objItem.VolumeSerialNumber
Next
=========
Also, documentation indicates the properties are read-only, so I believe
you cannot write values.
--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
.
- References:
- wim32 class?
- From: Linn Kubler
- Re: wim32 class?
- From: Richard Mueller [MVP]
- wim32 class?
- Prev by Date: Re: Does anyone have a script which will send a Text message to a cell phone?
- Next by Date: Email on user login/unlock
- Previous by thread: Re: wim32 class?
- Next by thread: Re: wim32 class?
- Index(es):
Relevant Pages
|