PowerShell for Windows Admins

Jun 23 2011   3:22PM GMT

root\wmi–set monitor brightness

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Oddly the methods for changing the brightness aren’t on the WmiMonitorBrightness we get a separate class with the methods. This function can be used to set the brightness

function set-monitorBrightness {
[CmdletBinding()]
param (
[ValidateRange(5,20)]
[int]$timeout=5,
 
[ValidateRange(0,100)]
[int]$brightness
)
$monitors = Get-WmiObject -Namespace root\wmi -Class WmiMonitorBrightnessMethods

foreach ($monitor in $monitors){
  $monitor.WmiSetBrightness($timeout, $brightness)  
}    
}

 

Timeout is in seconds and is the time the change takes.  Set to 20 and watch a slow change

Brightness is the % brightness setting. The system will set the brightness to the nearest level available (see previous post)

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: