Laptop Battery Audit - Windows
Log In or Register to download the BES file, and more.

1 Votes

Description

This analysis uses a combination of SMBIOS, WMI, and OMCI ( Dell Command | Monitor ) to report on batteries connected to a system. ( in particular laptop batteries, but also battery backups in some cases )

The best way to determine if a battery needs replaced is to look at the following properties:  "% battery life in capacity", "Battery Status", and "Battery Manufacture Date"

In the case of Dell Systems, the best data will be returned if Dell Command | Monitor (also known as OMCI) is installed. See the fixlet available here to install Dell OMCIhttp://bigfix.me/fixlet/details/3918

There is a related analysis for Apple OS X systems available here:  http://bigfix.me/analysis/details/2994537

 

References:

http://dmtf.org/sites/default/files/standards/documents/DSP0134_2.8.0.pdf

http://bigfix.me/relevance/details/2999628

http://www.dell.com/support/Manuals/us/en/19/Topic/dell-opnmang-clnt-instr-v9.0.0/Dell_Command_Monitor_Ref_Guide-v1/en-us/GUID-0176ACFB-3FF2-4895-9521-33C9BC948F0B

http://msdn.microsoft.com/en-us/library/aa394074%28v=vs.85%29.aspx

http://blogs.technet.com/b/heyscriptingguy/archive/2010/07/31/using-windows-powershell-to-determine-if-a-laptop-is-on-battery-power.aspx

 

 


Property Details

ID2994755
StatusQA - Ready for Production Level Testing
TitleLaptop Battery Audit - Windows
DomainBESC
Added by on 12/18/2014 12:35:41 PM
Last Modified by on 12/18/2014 12:35:41 PM
Counters 9874 Views / 63 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Properties

# of batteries
Period 2 days
 
  * Results in a true/false
Show indented relevance
maxima of ((number of structures whose(name of it as lowercase = "portable_battery") of smbios);(maxima of multiplicities of unique values of (preceding texts of firsts "=" of it) of (it as string) of selects "* from Win32_Battery" of wmis);(maxima of multiplicities of unique values of (preceding texts of firsts "=" of it) of (it as string) of selects "* from DCIM_Battery" of wmis "root\dcim\sysman"))
Raw SMBIOS battery data
Period 2 days
 
  * Results in a true/false
Show indented relevance
(name of it as trimmed string & "=" & it as string as trimmed string) of values of structures whose(name of it as lowercase = "portable_battery") of smbios
% battery life in capacity
Period 1 day
 
  * Results in a true/false
Show indented relevance
if not exists (selects "FullChargeCapacity from DCIM_Battery" of wmis "root\dcim\sysman") then ERROR "UNKNOWN" else ( (item 0 of it * 100 / item 1 of it) of (integer value of property "FullChargeCapacity" of it, integer value of property "DesignCapacity" of it) of select objects "* from DCIM_Battery" whose(exists integer values of properties "FullChargeCapacity" of it AND exists integer values of properties "DesignCapacity" of it) of wmis "root\dcim\sysman" )
Battery Status
Period 1 day
 
  * Results in a true/false
Show indented relevance
unique values whose(it != "") of (it as trimmed string) of string values of (if not exists (selects "Status from DCIM_Battery" of wmis "root\dcim\sysman") then it else (selects "Status from DCIM_Battery" of wmis "root\dcim\sysman")) of (selects "Status from Win32_Battery" of wmis)
Max Capacity (Wh)
Period 12 hours
 
  * Results in a true/false
Show indented relevance
unique values of (it / 1000) of significance places 2 of (item 0 of it * item 1 of it) of (value "design_capacity" of it as string as trimmed string as integer as floating point, value "design_capacity_multiplier" of it as string as trimmed string as integer as floating point) of structures "portable_battery" of smbios
Max Volts
Period 12 hours
 
  * Results in a true/false
Show indented relevance
unique values of (it / 1000) of significance places 2 of (it as string as trimmed string as integer as floating point) of values "design_voltage" of structures "portable_battery" of smbios
Max Amps
Period 12 hours
 
  * Results in a true/false
Show indented relevance
unique values of (it / 100) of significance places 0 of (it * 100) of (item 0 of it / item 1 of it) of (values "design_capacity" of it as string as trimmed string as integer as floating point, values "design_voltage" of it as string as trimmed string as integer as floating point) of structures "portable_battery" of smbios
Battery Manufacture Date
Period 12 hours
 
  * Results in a true/false
Show indented relevance
unique values of (it as string as trimmed string) of values "manufacture_date" of structures "portable_battery" of smbios
Battery Chemistry
Period 12 hours
 
  * Results in a true/false
Show indented relevance
(if it != "Unknown" then it else ( if (exists (unique values of (it as string as trimmed string) whose(it != "") of values "sbds_device_chemistry" of structures "portable_battery" of smbios)) then (unique values of (it as string as trimmed string) whose(it != "") of values "sbds_device_chemistry" of structures "portable_battery" of smbios) else "Unknown" )) of unique values of ( if exists it then it else "Unknown" ) of (tuple string items ( (it as string as trimmed string as integer) of values "device_chemistry" of structures "portable_battery" of smbios ) of "Unknown, Other, Unknown, Lead Acid, NiCad, NiMH, LION, Zinc Air, LiP")
EstimatedRunTime
Period 1 hour
 
  * Results in a true/false
Show indented relevance
unique values whose(it != /* This seems to be what Windows/WMI returns when it doesn't really have an answer: */ 71582788) of integer values of (if not exists (selects "EstimatedRunTime from DCIM_Battery" of wmis "root\dcim\sysman") whose( (exists integer values of it) AND (71582788 != integer value of it) ) then it else (selects "EstimatedRunTime from DCIM_Battery" of wmis "root\dcim\sysman")) of (selects "EstimatedRunTime from Win32_Battery" of wmis)
Names of Batteries
Period 12 hours
 
  * Results in a true/false
Show indented relevance
unique values of (it as trimmed string) whose(it != "") of ((string values of selects "Name from Win32_Battery" of wmis);(string values of selects "Name from DCIM_Battery" of wmis "root\dcim\sysman");((it as string) of values "device_name" of structures "portable_battery" of smbios))
DeviceID from Win32_Battery
Period 12 hours
 
  * Results in a true/false
Show indented relevance
unique values of (it as trimmed string) whose(it != "") of string values of selects "DeviceID from Win32_Battery" of wmis
Availability from Win32_Battery
Period 1 hour
 
  * Results in a true/false
Show indented relevance
unique values of integer values of selects "Availability from Win32_Battery" of wmis
Chemistry from Win32_Battery
Period 12 hours
 
  * Results in a true/false
Show indented relevance
unique values of (tuple string items ( integer values of selects "Chemistry from Win32_Battery" of wmis ) of "Unknown, Other, Unknown, Lead Acid, NiCad, NiMH, LION, Zinc Air, LiP, Unknown")
Chemistry from Win32_PortableBattery
Period 12 hours
 
  * Results in a true/false
Show indented relevance
unique values of (tuple string items ( integer values of selects "Chemistry from Win32_PortableBattery" of wmis ) of "Unknown, Other, Unknown, Lead Acid, NiCad, NiMH, LION, Zinc Air, LiP, Unknown")

Relevance

isWindows (Relevance 1172)
Used in 1152 fixlets and 538 analyses   * Results in a true/false
Show indented relevance
windows of operating system
Used in 1 analsis   * Results in a true/false
Show indented relevance
(exists structures whose(name of it as lowercase = "portable_battery") of smbios) OR (exists selects "* from Win32_Battery" of wmi) OR (exists selects "* from Win32_PortableBattery" of wmis) OR (exists selects "* from DCIM_Battery" of wmis "root\dcim\sysman")

Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!
jgstew -
I would look into what is available in WMI on these systems, as well as look for something similar to Dell Command Monitor / OMCI for these platforms that can extend WMI or provide a similar way to get the same data. I do believe HP has something like this, but I'm not sure about NEC. Without example HP or NEC systems to work from, there is little I can do to help, except that this existing analysis should provide a good starting point.
praveeneds -
Hi jgstew, Thank you for response. I have used this analysis for HP & NEC. For both these models, Full Charge capacity does not report. Any help would be greatly appreciately. Thank you.
jgstew -
what models does this not work for? I think that some of these values work for all windows devices with batteries, while others only work for dell systems that have Dell Command Monitor installed. This is pretty old at this point and I haven't looked at updating it in a while.
praveeneds -
Hi jgstew, thank you for the analysis. Do you have the analysis for all the models? I need to get Full charge capacity and battery health. Thank you
jgstew -
I probably need to re-write it to not just throw an error, or have a better error message, but that particular property only works on Dell systems that have "Dell Command Monitor" installed. It may work on some non-dell systems that have a similar thing to Dell Command Monitor from that manufacturer. It is technically checking for something in WMI that is a standard, but I don't know of other manufacturers implementing it.
rika -
Hello..for the battery life % this BES only returns error. Do I have to change something?