Abhilash
Abhilash

Reputation: 51

win32_powerplan does'nt work on windows server 2008

I have some wmi scripts which collect the server information, one among which is the windows power plan info.

I have used the following query

"SELECT ElementName,InstanceID,ISActive FROM win32_powerplan"

it works well againts win2k8 R2 and above but it failed when i ran it against win2k8.

according to thishttp://msdn.microsoft.com/en-us/library/windows/desktop/dd904531(v=vs.85).aspx it seems minimum requirement for win32_powerplan class to work is Windows Server 2008 R2.

Is there any other (wmi) way to get power plan info on a win2k8 server

Upvotes: 1

Views: 427

Answers (1)

RRUZ
RRUZ

Reputation: 136391

If the Win32_PowerPlan WMI class is not available, you can use the Power Scheme Management WinApi functions. Try the PowerEnumerate method.

Upvotes: 1

Related Questions