Lists information about the uninterruptible power sources attached to a computer.

This script was tested using Object REXX 2.1.0 for Microsoft Windows, available from IBM.

Object REXX
Edit|Remove
strComputer = "."
objWMIService = .OLEObject~GetObject("winmgmts:\\"||strComputer||"\root\CIMV2")
do objItem over objWMIService~ExecQuery("Select * from Win32_UninterruptiblePowerSupply")
    say "Active Input Voltage:" objItem~ActiveInputVoltage
    say "Availability:" objItem~Availability
    say "Battery Installed:" objItem~BatteryInstalled
    say "Can Turn Off Remotely:" objItem~CanTurnOffRemotely
    say "Caption:" objItem~Caption
    say "Command File:" objItem~CommandFile
    say "Config Manager Error Code:" objItem~ConfigManagerErrorCode
    say "Config Manager User Config:" objItem~ConfigManagerUserConfig
    say "Creation Class Name:" objItem~CreationClassName
    say "Description:" objItem~Description
    say "Device ID:" objItem~DeviceID
    say "Error Cleared:" objItem~ErrorCleared
    say "Error Description:" objItem~ErrorDescription
    say "Estimated Charge Remaining:" objItem~EstimatedChargeRemaining
    say "Estimated Run Time:" objItem~EstimatedRunTime
    say "First Message Delay:" objItem~FirstMessageDelay
    say "Install Date:" objItem~InstallDate
    say "Is Switching Supply:" objItem~IsSwitchingSupply
    say "Last Error Code:" objItem~LastErrorCode
    say "Low Battery Signal:" objItem~LowBatterySignal
    say "Message Interval:" objItem~MessageInterval
    say "Name:" objItem~Name
    say "PNP Device ID:" objItem~PNPDeviceID
    say "Power Fail Signal:" objItem~PowerFailSignal
    z = objItem~PowerManagementCapabilities
    if .NIL <> z then
        do x over z
            say objProperty.Name ": " x
    end
    say "Power Management Supported:" objItem~PowerManagementSupported
    say "Range 1 Input Frequency High:" objItem~Range1InputFrequencyHigh
    say "Range 1 Input Frequency Low:" objItem~Range1InputFrequencyLow
    say "Range 1 Input Voltage High:" objItem~Range1InputVoltageHigh
    say "Range 1 Input Voltage Low:" objItem~Range1InputVoltageLow
    say "Range 2 Input Frequency High:" objItem~Range2InputFrequencyHigh
    say "Range 2 Input Frequency Low:" objItem~Range2InputFrequencyLow
    say "Range 2 Input Voltage High:" objItem~Range2InputVoltageHigh
    say "Range 2 Input Voltage Low:" objItem~Range2InputVoltageLow
    say "Remaining Capacity Status:" objItem~RemainingCapacityStatus
    say "Status:" objItem~Status
    say "Status Info:" objItem~StatusInfo
    say "System Creation Class Name:" objItem~SystemCreationClassName
    say "System Name:" objItem~SystemName
    say "Time On Backup:" objItem~TimeOnBackup
    say "Total Output Power:" objItem~TotalOutputPower
    say "Type Of Range Switching:" objItem~TypeOfRangeSwitching
    say "UPS Port:" objItem~UPSPort
end