Installation

Install chocolatey from a powershell prompt

Set-ExecutionPolicy AllSigned; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Install python 3 and pip

choco install -y python pip

Install your libraries, for example

pip install wmi win32core

Snippets

WMI

Old and a bit raw but functionnal. Python2 translated to 3 examples from WMI cookbook

# -*- coding: ISO-8859-1 -*-

"""
Requirements
    pip install wmi win32core
"""

import wmi
c = wmi.WMI()

# Process list

for process in c.Win32_Process ():
  print(process.ProcessId, process.Name)

# List stopped services which should start automatically

stopped_services = c.Win32_Service (StartMode="Auto", State="Stopped")
if stopped_services:
  for s in stopped_services:
    print(s.Caption, "service is not running")
else:
  print("No auto services stopped")

# List disk spaces

for disk in c.Win32_LogicalDisk (DriveType=3):
  print(disk.Caption, "%0.2f%% free" % (100.0 * float(disk.FreeSpace) / float(disk.Size)))

# Wait for an error log and display it

c = wmi.WMI (privileges=["Security"])
watcher = c.watch_for(
  notification_type="Creation",
  wmi_class="Win32_NTLogEvent",
  Type="error"
)
while 1:
  error = watcher()
  print("Error in %s log: %s" %  (error.Logfile, error.Message))

winevt

Not mature yet, for exemple retrieving log can end up with utf-8 unable to decode ISO-8859-1...

from winevt import EventLog

query = EventLog.Query("System","Event/System[Level<=2]")
for event in query:
    print(event.System.Provider['Name'])