[IronPython] How would you use IronPython with WMI?

Keith J. Farmer kfarmer at thuban.org
Sat Aug 28 03:05:17 CEST 2004

import sys
from System.Management import *
def doSearch(searchString):
    for x in ManagementObjectSearcher(searchString).Get():
        for y in x.Properties:
            print str(y.Name) + ": " + str(y.Value)
        print "-----"
doSearch("select name, horizontalResolution, verticalResolution from win32_printer")
... I'd never done this sort of thing before.  Thanks :)


From: users-ironpython.com-bounces at lists.ironpython.com on behalf of Andy Shah
Sent: Fri 8/27/2004 4:40 PM

How does one use IronPython with WMI ?

I have a short code gleaned from a website


converted to python

from System.Management.Instrumentation import *

f = TestWMI.ROOT.CIMV2.Printer("Canon-Import")


More information about the Ironpython-users mailing list