[EMAIL PROTECTED] wrote:
HI all,
i have some problem with the code belove, i have a list of servers in
a textfile (elencopc.txt).... i would to retrieve informations via WMI
( cicle for ), but i don't understand if the code is correct:


Try this, using http://timgolden.me.uk/python/wmi.html :

<code>
import wmi

#
# For the test to work
#
open ("elencopc.txt", "w").write ("localhost")

for server in open ("elencopc.txt").read ().splitlines ():
  c = wmi.WMI (server)
  print "SERVER:", server
  for item in c.Win32_QuickFixEngineering ():
    print item # or print item.Caption, etc.
  print
  print

</code>

If you get RPC Server unavailable, it usually means that
the WMI service isn't running on that machine. Usually.

TJG
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to