[python-win32] Using Python and WMI for multiple machines

Tim Johnson tojo2000 at gmail.com
Wed Feb 20 07:55:31 CET 2008


You mean something like this?

servers = file('serverfile.txt')

for server in servers.readlines():
  servername = server.rstrip()
  MyWmiFunction(servername)




On Feb 19, 2008 10:32 PM, Becky Mcquilling <ladymcse2000 at gmail.com> wrote:

> I'm new to Python and wanted to do what is a pretty routine and common
> admin function,  simple enough in VBScript, but wanted to try it in Python
> as well.  I'm having troulbe working it out on my own.
>
> Here goes:
>
> I have a text file c:\servernames.txt.  I want the script to read from
> that file, each line being a different machine name, then give me a list of
> the services on the machine and the state, write the result to a log file.
>
> The wmi part is easy to produce, on a single machine, it's stripping the
> contents from a text file one at a time and then logging it to a file, that
> I havne't gotten quite right.
>
> I'm sure this is pretty simple for most of you, I just can't quite seem to
> get it.
>
> bmcquill
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
>


-- 
_____________________
Ceci n'est pas un email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20080219/7e183962/attachment.htm 


More information about the python-win32 mailing list