The problem here is that the Win32_PowerPlan
class is not a direct Win32
class in the \root\CIMV2
namespace, which is why it's not in this list of Win32 classes in the documentation.
It actually resides in the \\.\root\CIMV2\power
namespace as can be found by scrolling down to the table at the bottom of the Win32_PowerPlan
class documentation.
The code required to access this makes use of the moniker
parameter of the WMI()
class as follows:
c = wmi.WMI(moniker = "//./root/cimv2/power")
for plan in c.Win32_PowerPlan():
print plan