Use PowerShell to Report and Set Monitor Brightness

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to report and set monitor brightness.

Microsoft Scripting Guy, Ed Wilson, is here. Today I was exploring the Root/WMI namespace in Windows Management Instrumentation (WMI) on my Windows 8 laptop. I happened to run across a few WMI classes that I had not messed around with before. I like to use the Get-CimClass cmdlet from Windows PowerShell 3.0 for this kind of explorations because it supports tab completion and other features that make this exploration easy.

Look for WMI classes related to monitor brightness

So I was initially looking for anything related to monitors. And as I looked at what scrolled by, I saw that there were classes related to monitor brightness. So I decided to modify my query a bit to include things related to monitor brightness. I derived the following command, and achieved the results shown here:

PS C:> Get-CimClass -Namespace root/WMI -ClassName *monitorbrightness*


   NameSpace: ROOT/wmi


CimClassName                        CimClassMethods      CimClassProperties

------------                        ---------------      ------------------

WmiMonitorBrightnessEvent           {}                   {SECURITY_DESCRIPTOR, TI...

WmiMonitorBrightness                {}                   {Active, CurrentBrightne...

WmiMonitorBrightnessMethods         {WmiSetBrightness... {Active, InstanceName}

I thought I would try to query the WmiMonitorBrightness WMI class first because it looks like it would report first. So I edited my previous line and changed from Get-CimClass to Get-CimInstance. Here is the command, and the output associated with the command:

PS C:> Get-Ciminstance -Namespace root/WMI -ClassName WmiMonitorBrightness


Active            : True

CurrentBrightness : 100

InstanceName      : DISPLAYLEN40B24&3062e51&0&UID67568640_0

Level             : {0, 1, 2, 3...}

Levels            : 101

PSComputerName    :

So without any reference material, I can see that the current brightness of my laptop monitor is 100. This is probably a percentage setting. I connect to MSDN, and look up WmiMonitorBrightness class. Sure enough it is the current brightness of the monitor as a percentage. The Level property lists supported values for CurrentBrightness. I check it by piping the results to the Select-Object cmdlet. Here is a sample of the output:

PS C:> Get-Ciminstance -Namespace root/WMI -ClassName WmiMonitorBrightness | select

-ExpandProperty level







The strange thing is that Level lists how many different levels are available. The value of 101 makes sense because Level begins with 0 and ends with 100.

Set the brightness

To set the brightness on my laptop display monitor, I figure I can use the WmiMonitorBrightNessMethods WMI class. While I have MSDN open, I check out WmiMonitorBrightnessMethods class, and it appears that I will be able to use it to set my monitor brightness:

PS C:> Get-CimClass -Namespace root/WMI -ClassName WmiMonitorBrightnessMethods

   NameSpace: ROOT/WMI


CimClassName                        CimClassMethods      CimClassProperties

------------                        ---------------      ------------------

WmiMonitorBrightnessMethods         {WmiSetBrightness... {Active, InstanceName}

There are only two properties: Active and InstanceName. I decide to look at them. Here is the result:

PS C:> Get-CimInstance -Namespace root/WMI -ClassName WmiMonitorBrightnessMethods

                      Active InstanceName                PSComputerName

                      ------ ------------                --------------

                        True DISPLAYLEN40B24&3062e5...

Examine the WMI class methods

So, the WmiMonitorBrightnessMethods WMI class looks like it might be useful. Now, I want to look at the method information in more detail:

PS C:> $wmi.CimClassMethods


Name                            ReturnType Parameters           Qualifiers

----                            ---------- ----------           ----------

WmiSetBrightness                   Boolean {Brightness, Time... {Implemented, Wmi...

WmiRevertToPolicyB...              Boolean {}                   {Implemented, Wmi...

WmiSetALSBrightnes...              Boolean {State}              {Implemented, Wmi...

WmiSetALSBrightness                Boolean {Brightness}         {Implemented, Wmi...

I see that there are four methods for the WmiMonitorBrightnessMethods class. The method that looks like it is the best one for my needs is the WmiSetBrightness method. It takes two parameters that I want to look at in more detail. So I adjust my query to focus on it. I use the Item method to specify which method I want to look at. The command is shown here:

PS C:> $wmi.CimClassMethods.Item('wmiSetBrightness')


Name                            ReturnType Parameters           Qualifiers

----                            ---------- ----------           ----------

WmiSetBrightness                   Boolean {Brightness, Time... {Implemented, Wmi...

But the parameters information is still truncated. So I add Parameters to the end of my query and arrive at the following:

PS C:> $wmi.CimClassMethods.Item('wmiSetBrightness').parameters


Name                               CimType Qualifiers           ReferenceClassName

----                               ------- ----------           ------------------

Brightness                           UInt8 {ID, in}

Timeout                             UInt32 {ID, in}

Cool. Now I know the two parameters that I need to use to call this method. Brightness is expressed as a percentage, and Timeout is expressed in seconds.

I use the Get-WmiObject cmdlet to query the WmiMonitorBrightnessMethods WMI class, and store the returned object in a variable as shown here:

$monitor = Get-WmiObject -ns root/wmi -class wmiMonitorBrightNessMethods

Now, I call the WmiSetBrightNess method and specify that I want the monitor to be at 80% and request that it do so in 10 seconds. Here is the command:


Cool! It works. Not sure how I will use this, but it does work.

Well, that is all there is to using the WMI classes to set monitor brightness. Join me tomorrow when I will talk about more cool Windows PowerShell stuff.

I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at, or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.

Ed Wilson, Microsoft Scripting Guy

Comments (7)

  1. jrv says:

    @Ed @retro

    It only works on systems that can dynamically set the brightness.  This usually only laptops although some All-In-Ones may have this capability..

    On my laptop this works.  On my desktop it says "Not supported" which is correct because I cannot set the brightness from the OS.  I can only do that on the monitor.  Very few full monitors allow adjustment from the OS and only if you install the monitor driver.

  2. jrv says:


    Coincidence but I ran through all of that only about two days before you posted it.  I had to do a little thinking and research to see why and how it worked.

    If anyone has an HP All-In-One I suspect it will work on those.  I believe they are mostly laptop technology on the desktop.

    Newer monitors are also supporting the 'auto-daylight-detect' feature that is in most laptops and adding it.  Newer monitors can also run USB over the video path.  Tis makes them available to self-install the driver and to support thumb drives, mice and keyboards.

    it's an everything-everywhere world.

  3. Retro says:

    Hi, im new to powershell. When I run this command

    Get-Ciminstance -Namespace root/WMI -ClassName WmiMonitorBrightness

    It just says

    Get-Ciminstance : Not supported

    At line:1 char:1

    Any ideas?

  4. Ed Wilson says:

    @Retro according to MSDN…/aa394536(v=vs.85).aspx
    it should work on Vista and Above. I ran this on my Windows 8 laptop (64 bit) and it works as indicated above.

  5. Ed Wilson says:

    @JRV Great catch! It has been so long since I used an actual desktop, that I forget about them. Thank for testing this out!

  6. Retro says:

    @Ed @Jrv Thanks. That explains it. It was confusing the heck out of me 🙂

  7. Willbur says:

    I started to try to use this, and then realized it only works on Windows 8 right now so is completely useless in the majority of companies until at least Windows 9 comes out.

Skip to main content