On Aug 30, 1:04 am, “Chris H.” [email protected] wrote:
Windows box’s user name and password to gather all the information and
will dump it in STDOUT.
Any hints or tips on where to start looking to write something like
this would be much appreciated.
If your program is running on a Windows computer, it’s actually pretty
easy to get reams of information from remote Windows computers.
Windows Management Instrumentation (WMUI), part of Microsoft’s
implementation of the Web-based Enterprise Management (WBEM) standard,
is built in to all Windows versions since Windows 2000, I think, and
it can be added onto Windows 98. To query remote computers, you have
to be a member of a security group that includes local administrator
authority for the remote computers, e.g. domain admins. If you’re not
a member of such a group, you probably shouldn’t be querying those
computers. Using WMI, you can collect far more information than is
practical to display to the terminal.
To get an idea of the information that’s available, download
Microsoft’s Scriptomatic 2.0 at
and run some of the built-in queries on your own computer.
Scriptomatic generate scripts in VB Script and Perl, among others, and
it’s not hard to translate them to ruby once you know how. In ruby,
the basic WMI calls are executed with win320le. Take a look at the
example programs http://snippets.dzone.com/posts/show/4280 and
explains some of the basic translations from vbscript to win32ole in
ruby. There’s a lot of other helpful information at
showing you how to interface to other Microsoft products. The pickaxe
book provides some good examples for manipulating Excel with
win32ole. The Microsoft Scripting Guys did some great webcasts on WMI
scripting on the Microsoft Technet site.
I think that should be enough to get you started. Good luck.