Categories

root\wmi – Monitor brightness

The monitor brightness can be discovered like this

function get-monitorBrightness {

$monitors = Get-WmiObject -Namespace root\wmi -Class WmiMonitorBrightness

foreach ($monitor in $monitors){
  $brightness = New-Object -TypeName PSObject -Property @{
        CurrentLevel = $monitor.CurrentBrightness
        MaxLevel = $($monitor.Level | sort | select -Last 1)
     }
  $brightness  
}    
}

 

The WmiMonitorBrightness class is used. The level property holds the brightness levels that can be set. A simple sort ensures we get the maximum setting

4 Responses to root\wmi – Monitor brightness

  • Unfortunately this won’t work for me on my Windows 7 box. WMI query throws an exception:
    [↓] [vPodans] gwmi -Namespace root\wmi -class WmiMonitorBrightness
    Get-WmiObject : Not supported
    At line:1 char:5
    + gwmi <<<< -Namespace root\wmi -class WmiMonitorBrightness
    + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

  • RichardSiddaway says:

    It depends on whether your monitor supports the WMI interface – I’ve seen the same results on Windows 7 systems

  • It seems that neither of my monitors (notebook and Samsung SyncMaster) supports these classes.

  • Ignacio Baca Moreno-Torres says:

    My Dell laptop support these classes, and operates correctly, but is it possible to change the Level parameter, so I can use levels lower than the minimum? In my laptop min level is 6. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>