![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | WMI script to obtain Power Supply information I am writting a server inventory database and using WMI VBScripts to obtain the data. So far I have been able to easily get RAM, CPU, Model, etc. information using WMI. I am now trying to collect the total number of powers supplies in a server. For example a HP DL380 G5 might have 1 or 2 power supplies installed in it. I cannot find any information (Google, Bing, etc.) regarding how to get this information. I found Win32_PowerSupply but Google only yields one hit. When I try to use this class, it errors out. Here is a tidbit of the code: For Each objItem in objDictionary Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & objDictionary.Item(objItem) & "\root\cimv2") Set colPowerSupply = objWMIService.ExecQuery("Select * from Win32_PowerSupply") For Each objPS in colPowerSupply objResultsFile.WriteLine(objDictionary.Item(objItem) & "," & objPS.Name) Next Next It basically fails at the "For Each objPS in colPowerSupply" line. Anyone have any ideas how to get this information? Is it stored in the registry maybe and I can query that instead? Trying to Google this has been a nightmare compared to how easy it was to find sample scripts on other inventory gathering techniques. Thanks Nelson |
My System Specs![]() |
| | #2 (permalink) |
| | Re: WMI script to obtain Power Supply information "Nelson" <Nelson@xxxxxx> wrote in message news:B0B1E290-4687-4F94-A470-A1F23D03EC84@xxxxxx Quote: >I am writting a server inventory database and using WMI VBScripts to obtain > the data. So far I have been able to easily get RAM, CPU, Model, etc. > information using WMI. I am now trying to collect the total number of > powers > supplies in a server. For example a HP DL380 G5 might have 1 or 2 power > supplies installed in it. > > I cannot find any information (Google, Bing, etc.) regarding how to get > this > information. I found Win32_PowerSupply but Google only yields one hit. > When > I try to use this class, it errors out. Here is a tidbit of the code: > > For Each objItem in objDictionary > Set objWMIService = GetObject("winmgmts:" & > "{impersonationLevel=impersonate}!\\" & objDictionary.Item(objItem) & > "\root\cimv2") > Set colPowerSupply = objWMIService.ExecQuery("Select * from > Win32_PowerSupply") > For Each objPS in colPowerSupply > objResultsFile.WriteLine(objDictionary.Item(objItem) & "," & objPS.Name) > Next > Next > > It basically fails at the "For Each objPS in colPowerSupply" line. > > Anyone have any ideas how to get this information? Is it stored in the > registry maybe and I can query that instead? Trying to Google this has > been > a nightmare compared to how easy it was to find sample scripts on other > inventory gathering techniques. > > Thanks > Nelson -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: WMI script to obtain Power Supply information On Jun 9, 2:34*pm, David Kerber <ns_dkerber@xxxxxx_WarrenRogersAssociates.com> wrote: Quote: > In article <e4ND#eT6JHA.1...@xxxxxx>, rlmueller- > nos...@xxxxxx says... > > ... > Quote: Quote: > > > It basically fails at the "For Each objPS in colPowerSupply" line. Quote: Quote: > > > Anyone have any ideas how to get this information? *Is it stored inthe > > > registry maybe and I can query that instead? *Trying to Google thishas > > > been > > > a nightmare compared to how easy it was to find sample scripts on other > > > inventory gathering techniques. Quote: Quote: > > > Thanks > > > Nelson Quote: > > I cannot find a machine where the Win32_PowerSupply class is supported. > I would be shocked if windows tracked (or could even get) information > about power supplies. *If it is available in some machines, it's almost > certainly mfr's speciial hardware management software that is providing > it. > > -- > /~\ The ASCII > \ / Ribbon Campaign > *X *Against HTML > / \ Email! > > Remove the ns_ from if replying by e-mail (but keep posts in the > newsgroups if possible). If you use HP/Compaq servers and you have installed the Management agents, You will find a Name Space called root\HPQ that has 363 classes associated with it. Basically, every thing the HP Management agents know about the server is available. This might be of use to you OldDog |
My System Specs![]() |
| | #4 (permalink) |
| | Re: WMI script to obtain Power Supply information Excellent. Thanks to all three of you for taking the time to reply. Nelson "OldDog" wrote: Quote: > On Jun 9, 2:34 pm, David Kerber > <ns_dkerber@xxxxxx_WarrenRogersAssociates.com> wrote: Quote: > > In article <e4ND#eT6JHA.1...@xxxxxx>, rlmueller- > > nos...@xxxxxx says... > > > > ... > > Quote: > > > > It basically fails at the "For Each objPS in colPowerSupply" line. Quote: > > > > Anyone have any ideas how to get this information? Is it stored in the > > > > registry maybe and I can query that instead? Trying to Google this has > > > > been > > > > a nightmare compared to how easy it was to find sample scripts on other > > > > inventory gathering techniques. Quote: > > > > Thanks > > > > Nelson Quote: > > > I cannot find a machine where the Win32_PowerSupply class is supported. > > I would be shocked if windows tracked (or could even get) information > > about power supplies. If it is available in some machines, it's almost > > certainly mfr's speciial hardware management software that is providing > > it. > > > > -- > > /~\ The ASCII > > \ / Ribbon Campaign > > X Against HTML > > / \ Email! > > > > Remove the ns_ from if replying by e-mail (but keep posts in the > > newsgroups if possible). > I just ran across something that I found interesting. > If you use HP/Compaq servers and you have installed the Management > agents, > You will find a Name Space called root\HPQ that has 363 classes > associated with it. > > Basically, every thing the HP Management agents know about the server > is available. > > This might be of use to you > > OldDog > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Power supply help | Software | |||
| Need new power supply | General Discussion | |||
| power supply | General Discussion | |||
| Bad Power Supply | Vista installation & setup | |||
| Power Supply - Request for information | General Discussion | |||