It does of course help to spell IPAddress correctly to get this to work in the first place. LOL. It is working...thanks again for the help and the wonderful module!
On Tue, Sep 16, 2008 at 1:36 PM, Spencer Parker <[EMAIL PROTECTED]>wrote: > This is the code that I currently have: > > import wmi > > con =wmi.WMI() > ip = "10.1.10.20" > subnet = "255.255.255.0" > gateway = "10.1.10.1" > > wql = "SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = > TRUE" > > for adapter in con.query(wql): > ReturnValue = adapter.EnableStatic(IPAddress=ip, SubnetMask=subnet) > > > On Tue, Sep 16, 2008 at 1:01 PM, Tim Golden <[EMAIL PROTECTED]> wrote: > >> Spencer Parker wrote: >> >>> Has anyone here had any experience with WMI extensions in Python? >>> >>> I am trying to remotely change the IP, Subnet, and gateway of a windows >>> machine, but I cannot figure out what it needs to change this. >>> >> >> You'll need the Win32_NetworkAdapterConfiguration class and, >> for ease, the wmi module from here: >> >> http://timgolden.me.uk/python/wmi.html >> >> <code> >> import wmi >> >> c = wmi.WMI () >> >> for i in c.Win32_NetworkAdapterConfiguration (IPEnabled=True): >> print i >> >> You'll need things like the .SetGateways method. You can see >> all the methods thus: >> >> print "\n".join (i.methods) >> >> and if you print any of them, it will show its signature: >> >> print i.SetGateways >> >> </code> >> >> >> HTH >> TJG >> _______________________________________________ >> Tutor maillist - Tutor@python.org >> http://mail.python.org/mailman/listinfo/tutor >> > > > > -- > Spencer Parker > > -- Spencer Parker
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor