Managing Windows from Linux via Ruby

G

Glen Holcomb

[Note: parts of this message were removed to make it a legal post.]

Does anyone know of a reliable way to manage resources on Windows machines
from a Linux platform using Ruby? I'm currently using win32api and win32ole
to create directories and set permissions on multiple remote Windows
machines but would like to migrate my application to a Linux platform. I'm
also interacting with AD but that works fine with LDAP.

Anyone have any suggestions on how I could go about this, or is it not worth
my while?

Thanks,
Glen
 
M

Martin DeMello

Does anyone know of a reliable way to manage resources on Windows machines
from a Linux platform using Ruby? I'm currently using win32api and win32ole
to create directories and set permissions on multiple remote Windows
machines but would like to migrate my application to a Linux platform. I'm
also interacting with AD but that works fine with LDAP.

Anyone have any suggestions on how I could go about this, or is it not worth
my while?

One reasonably cheap way is to use win32-service to run a drb server
that calls your other windows libraries across the network from your
linux box. I've used this approach quite successfully, albeit for very
trivial tasks. I used rubyscript2exe and srvany.exe to make the
service, because i was unaware of win32-service at the time; if I had
to do it again I'd probably use the latter.

martin
 
G

Glen Holcomb

[Note: parts of this message were removed to make it a legal post.]

One reasonably cheap way is to use win32-service to run a drb server
that calls your other windows libraries across the network from your
linux box. I've used this approach quite successfully, albeit for very
trivial tasks. I used rubyscript2exe and srvany.exe to make the
service, because i was unaware of win32-service at the time; if I had
to do it again I'd probably use the latter.

martin


Thanks for the idea Martin. It doesn't sound too horrible. I'll look into
it.
 
M

Marc Heiler

I've used this approach quite successfully, albeit for very
trivial tasks.

Trivial tasks sound great, it makes understanding them easier :)

Do you have a few example scripts for that? Just a few things what
is possible like that, snippets and the like.
(If you dont, dont worry, I dont intend to steal anyone's time).

I am using Linux mostly, but it would be nice if all the scripts on my
Linux box could work on my Windows machine just as well - but with me
staying here, and not even connecting via ssh or similar.
 
R

Rodrigo Bermejo

If you can access the windows boxes through SSH , you can trigger the
execution of any code you may run on the remote machine.
Drb is a more elegant solution.
 
M

Martin DeMello

Trivial tasks sound great, it makes understanding them easier :)

Do you have a few example scripts for that? Just a few things what
is possible like that, snippets and the like.
(If you dont, dont worry, I dont intend to steal anyone's time).

Sorry, no :( It was a while ago and I don't have a windows box any
more. The basic setup was very simple, though - I wrote a bunch of
code to do stuff, based on the excellent ruby-win32 library, then I
created an object that exposed all the methods thro drb, ran the
script through rubyscript.exe to create an executable, and then ran
anysrv.exe and instsrv.exe from the windows resource kit to install it
as a service. One problem is that sometimes stopping the service left
a stray ruby.exe process lying around, which is why I said I'd do it
using win32-service rather than anyserv if I had to do it again.

martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top