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

Published Thu, Jun 23 2011 22:15 by RichardSiddaway

Comments

# re: 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

Sunday, June 26, 2011 9:27 AM by Vadims Podans

# re: root\wmi - Monitor brightness

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

Sunday, June 26, 2011 1:11 PM by RichardSiddaway

# Monitor brightness&ndash;or not - PowerShell for Windows Admins

Pingback from  Monitor brightness–or not - PowerShell for Windows Admins

# re: root\wmi - Monitor brightness

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

Monday, June 27, 2011 12:26 AM by Vadims Podans

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: