X-Platform method of remote execution of Windows programs

Tim Golden tim.golden at viacom-outdoor.co.uk
Tue Aug 23 14:41:07 CEST 2005


[utabintarbo at gmail.com]

| It seems as if I am doomed to use additional software on the windows
| box. Damn!

'Fraid so. If your question is: given a vanilla Windows box, can
I invoke an executable on the Windows box from a Linux box? I
believe the later versions of Windows run or can run Terminal
Services by default, which can be invoked by the Remote Desktop
protocol, but not -- I think -- any kind of Shell. Could be
wrong.

Of course, there are a thousand and one ways of doing this if
you're prepared to have a long-running process (in Python or
anything else which takes your fancy) which you can connect to
with some command or other. Obvious possibilities in the Python
line are: Pyro, XML-RPC, a socket server, Twisted, and so on.
But you probably knew that.

| The "unclarity" is in the authentication for the remote box. If I wish
| to start a process on a remote box with another user's credentials
| (other than the user I am logged in as), I am unsure as to how to
| accomplish this. Anything you can add to the docs concerning 
| this would
| be greatly appreciated.

Thanks for the info. The answer is to use the slightly
ungainly connect_server function. I've added an example
on the cookbook page:

http://timgolden.me.uk/python/wmi_cookbook.html#connect_as_a_named_user

and I'd encourage you, if you haven't already, to look at the docstring
documentation for the module, which is sometimes more useful than what
I've got on the site. (Note to self: must do something about that).

I have an oft-promised and not-yet-released version 1.0 of this module,
which has a slightly tidier connection function, allowing you to call
just one method (.connect, in fact) in which you can specify whatever
combination of username, security context, namespace, etc. is allowed
by the underlying calls. Not there yet, though.

Hope that helps.
TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-list mailing list