PC Review


Reply
Thread Tools Rate Thread

Configure Presentation Power schemes settings via WMi/API

 
 
rflazaro
Guest
Posts: n/a
 
      28th Nov 2007
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!
 
Reply With Quote
 
 
 
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      28th Nov 2007
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.

"rflazaro" <(E-Mail Removed)> wrote in message
news:5BE32B17-AFD2-4710-87DD-(E-Mail Removed)...
> 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!



 
Reply With Quote
 
rflazaro
Guest
Posts: n/a
 
      29th Nov 2007
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!


"Willy Denoyette [MVP]" wrote:

> 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.
>
> "rflazaro" <(E-Mail Removed)> wrote in message
> news:5BE32B17-AFD2-4710-87DD-(E-Mail Removed)...
> > 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!

>
>
>

 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      29th Nov 2007
"rflazaro" <(E-Mail Removed)> wrote in message
news:A1D8A776-861D-4A1D-BADA-(E-Mail Removed)...
> 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.



 
Reply With Quote
 
rflazaro
Guest
Posts: n/a
 
      29th Nov 2007
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.

"Willy Denoyette [MVP]" wrote:

> "rflazaro" <(E-Mail Removed)> wrote in message
> news:A1D8A776-861D-4A1D-BADA-(E-Mail Removed)...
> > 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.
>


 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      29th Nov 2007
"rflazaro" <(E-Mail Removed)> wrote in message
news:C524B759-BBF8-4C18-8274-(E-Mail Removed)...
> 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.


 
Reply With Quote
 
rflazaro
Guest
Posts: n/a
 
      3rd Dec 2007
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!

"Willy Denoyette [MVP]" wrote:

> "rflazaro" <(E-Mail Removed)> wrote in message
> news:C524B759-BBF8-4C18-8274-(E-Mail Removed)...
> > 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.
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Power schemes and settings Jerry Windows XP Configuration 0 12th Jan 2005 07:40 PM
Power schemes and settings Jerry Windows XP Setup 0 12th Jan 2005 07:40 PM
Power schemes and settings Jerry Windows XP General 0 12th Jan 2005 07:40 PM
Power schemes/settings James Microsoft Windows 2000 1 12th Mar 2004 05:26 PM
Re: Power Schemes Settings Steve Windows XP General 0 13th Sep 2003 10:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:43 AM.