DCOM/WMI client implementation for Linux.
    andrzej.hajda@wp.pl, 2006-2007

ABOUT

This implementation of DCOM/WMI client is based on Samba4 sources. 
It uses RPC/DCOM mechanism to interact with WMI services on 
Windows 2000/XP/2003 machines.
It contains also winexe - program to remote execution Windows commands remotely from Linux box.
Additional info about winexe at http://eol.ovh.org/winexe/.

REQUIREMENTS

The same as for Samba (gcc ???, autoconf ???).
For python bindings:
 - SWIG >= 1.3 (I am using version 1.3.25).
 - Python >= 2.3.
For winexe:
 - crossmingw32-binutils
 - crossmingw32-gcc
 - crossmingw32-gcc-c++
 - crossmingw32-w32api


COMPILATION

Simple steps(change python path if necessary):
$ cd Samba/source
$ ./autogen.sh
$ CPPFLAGS="-I/usr/include/python2.4" ./configure
$ make proto bin/wmic bin/wmis wmi/_pywmi.so bin/winexe

BUILDING ON MAC

$ cd Samba/source
$ ./autogen.sh
$ CPPFLAGS="-I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4/" ./configure
$ make proto bin/wmic bin/wmis wmi/_pywmi.dylib bin/winexe


For details check Samba documentation in Samba/howto.txt.

INSTALLATION

Currently there is no install procedure. Generated binaries are located 
in Samba/source:
  bin/wmic - WMI simple client, it queries server using ExecQuery WMI method,
	 sample usage: 
	    wmic -U domain/user%password //host "select Name from Win32_Process"
	 Program is at early stage of development and there are many bugs.
	 To retrieve more debug info use switch "-d number", where bigger number
         corresponds to bigger output (I am using "-d 99" :) )
  bin/wmis - WMI test suite. Currently it does only following things:
	- Creates directory remotely using Win32_Process.Create("cmd.exe /C mkdir C:\wmi_test_dir_tmp").
	- Executes ExecNotificationQuery for monitoring file create/delete events in this directory.
	- Waits for 4 notifications and display their types.
  wmi/_pywmi.so - Samba wrapper for python, together with wmi/pywmi.py and ../pycom/* modules can be used 
	to run zenwin on Linux.
  bin/winexe - Remote windows commands execution.
	Sample usage:
	    winexe -U domain/user%password //192.168.0.3 "ipconfig /all"

PYTHON MODULES (early stage, experimental, for zenwin)

There are two locations of python modules required to run zenwin:
- ./pycom - modules providing api of pywin32 library used in zenwin.
- ./Samba/source/wmi - SWIG generated Samba binding modules (pywmi.py, _pywmi.so), used by ./pycom.
To run zenwin you should:
0. Compile _pywmi.so module, see COMPILATION section.
1. Download zenwin: svn co http://dev.zenoss.org/svn/trunk/zenwin.
2. Edit zenwin config files if necessary.
3. Configure/run zenoss.
4. Run zenwin components, with properly set env variable PYTHONPATH, for example in bash/sh:
cd $ZENWINPATH
PYTHONPATH="$WMIPATH/pycom:$WMIPATH/Samba/source/wmi" python ./$PROG.py -C etc/$PROG.cfg -v 10 --cycle=5
where:
    ZENWINPATH - path to zenwin directory
    WMIPATH - path to wmi directory
    PROG - one of zenwin components (zenwin, zenwinmodeler, zeneventlog)

TODO

- Implement handling of all CIM types,
- Free unused memory,
- Release DCOM objects

General:
- Create async version
