Windows WMI (over DCE/RPC) with Samba?

Peter Valdemar Mørch swp5jhu02 at sneakemail.com
Tue Mar 2 08:18:17 GMT 2004


Background:

Windows has the nifty WMI - Windows Management
Instrumentation API. WMI is ideal for remote management of Windows
machines as you can extract an incredible wealth of information about
installed software, event log, performance, hardware, you-name-it via
WMI, all without installing any software at all on the windows
machines. For us it is very important to avoid having to install
software on all Windows hosts.

I've taken a look with Ethereal what is going on during WMI between
two windows machines, and MS DCE/RPC turns up again and again - so I
thought of Samba...

I don't think access to WMI is possible with Samba or with any other
Linux code, as it is. (grep -i wmi `find . -name *.c -type f` under
samba-3.0.2a/ returns nothing but an OT comment...)

Now my question:

Does anybody have an idea whether / how easy support for WMI would be?

I realize from reading the reviews of Luke Leightons: "DCE/RPC over
SMB: Samba and Windows NT Domain Internals" that this may not even be
feasable, but I thought I'd ask here specifically about WMI...

source/rpcclient/cmd_reg.c once implemented access to the remote
repository, and apparently it was disabled (in r 1.37 - Aug 2001)
because an internal Samba API changed, and it wasn't deemed important
enough to keep up to date (I guess). The log message says nothing
about the disabling but the code currently has:

#if 0 /* Simo: reg functions need to be updated to the new cmd
          interface */

Would that be "easy" to resurrect, BTW? Is it just an API change? Or
is there some more sinister underlying change that makes it almost
impossible?

Alternatively: is there any way to execute an arbitrary command via
RPC, such as C:\checkHost.exe? Is it possible using Samba? Then we
could smbmount + cp + RPC_execute... I'm surprised if there isn't :-D

In summary - and in order of priority - we'd love either:

1) Access to WMI over DCE/RPC
2) Ability to execute an arbitrary remote command on a windows host
3) Read access to remote repositories

At the moment, our only alternative seems to be to create a Windows
service / daemon running as a "proxy" for all our WMI needs - under
wine, maybe. "There has got to be a better way!"

This would be *very* useful to anybody doing network management from
Linux - so I'm hoping that somebody here has a wonderfully easy idea
how to do it, but that nobody thought it would be useful! (Hey - I
believe in Santa Claus too!)

Sincerely,

Peter Mørch
-- 
Peter Valdemar Mørch
http://www.morch.com


More information about the samba-technical mailing list