Configure Presentation Power schemes settings via WMi/API

R

rflazaro

Hi All,

We are trying to build an automation utility to configure OS. I found a way
to automate the processes below via registry:

Control Panel -> Power Options -> Power Schemes Tab:
-> Power schemes -> Presentation

Turn off monitor Never
Turn off hard disks Never
System Standby Never

HKEY_CURRENT_USER\Control Panel\PowerCfg
String Value name Value Data
CurrentPowerPolicy 2

HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\2
- set above settings then export the key
- run the imported registry setting in the code

But may I ask for anyone who could help me find a way to automate in C# the
process above via WMI/API?

Thanks in advance!
 
W

Willy Denoyette [MVP]

This and all of your previous questions can be answered by using the RSoP
WMI Classes, you should also take a look at the GPO command line tools.
Search MSDN for RSOP.

Willy.
 
R

rflazaro

Hi,

Thanks for the reply but I don't think RSoP will work for my case. The Group
Policy Management Console can only be installed in a domain server. I forgot
to mention that I'm currently using WEPOS as my OS for the automation. Sorry
my bad!
 
W

Willy Denoyette [MVP]

rflazaro said:
Hi,

Thanks for the reply but I don't think RSoP will work for my case. The
Group
Policy Management Console can only be installed in a domain server. I
forgot
to mention that I'm currently using WEPOS as my OS for the automation.
Sorry
my bad!

GPM Console and RSoP can be used for Local (registry policy seting) Computer
Policy management, just run mmc and add the "Local Computer Policy" add-in,
and look at the Computer and User Configuration - Administrative Templates.
These templates contain the information you are looking for.
Don't know whether WEPOS contains the RSoP WMI provider though, this is
something you can find out by running wbemtest and connect to the root/rsop
namespace.

Willy.
 
R

rflazaro

Hi,

I was able to explore on the GPM Console by running gpedit.msc in the
command prompt just to see what are the available policies I could use via
RSoP but it seems to not have some of the policies that I am having trouble
with automating including how to configure Presentation Power schemes
settings. :(
 
W

Willy Denoyette [MVP]

rflazaro said:
Hi,

I was able to explore on the GPM Console by running gpedit.msc in the
command prompt just to see what are the available policies I could use via
RSoP but it seems to not have some of the policies that I am having
trouble
with automating including how to configure Presentation Power schemes
settings. :(


This specific Power Management option is only available in Vista and higher.
What stops you from setting this through the Registry API's?


Willy.
 
R

rflazaro

Hi Will,

I have problem setting this by tweaking the registry for I haven't found a
registry key that would help me do this. Anyways, thanks for the reply. We'll
probably make this a limitation to our automation project.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top