WMI in Python
wuwei23 at gmail.com
Thu Sep 16 04:01:07 CEST 2010
KING LABS <kinglabs... at gmail.com> wrote:
> The following information is exactly what I am trying to collect for
> the inventory. I can find vb scripts with googling. I want to do the
> same with Python & Win32. Use Server/Client architecture .
> Client(agent) updates the information to server.
I highly agree with the recommendations for Tim Golden's WMI library.
I once used it during an MS VBScript course for sys admins to produce
python equivalents of the VBS code; it was far, _far_ easier to
componentise & reuse python code than VBS.
However, for a quick & ready solution, have you looked at Microsoft's
Scriptomatic? It's a handy little tool that lets you specify the
WMI query you want and produces code for you, with Python being one of
the targets. It _should_ be able to handle most of everything you're
after, with the exception of Software Information (from memory that's
not something WMI covers?).
Once Scriptomatic has generated the bulk of the WMI code, that's the
payload of your client-side script. There are many many many ways of
doing simple client/server set ups in python, just google and pick one
that works at a suitable abstraction level for you. Here's a
straightforward sockets-based approach (that I've never used but
More information about the Python-list