Brief: This article discusses winexe, a tool seemingly identical to Microsoft’s own psexec (from the pstools package), which allows for a pseudo-telnet or simple remote running of a command from one machine to another. winexe specifically allows that administration machine to run Linux.
A little known gem of the IT world is the PsTools suite, originally available on resource discs for Windows NT/2K. One program of particular interest in this suite of command line tools was psexec, which allowed one computer to remotely log in and issue commands on another (Windows) computer, but without any client service software (well, technically there is, but we’ll get to that). Here’s an example:
(from the administrator’s computer, S-ADMIN):
C:\pstools\psexec.exe \\S-REMOTE “ipconfig /all”
The command above would run the useful “ipconfig /all” command on the computer S-REMOTE, but display the results on S-ADMIN (the computer issuing the command). Even more interesting, one could issue this command as well:
C:\pstools\psexec.exe \\S-REMOTE “cmd.exe”
which essentially starts a telnet session on S-REMOTE.
What makes this all the more interesting is that unlike tools such as DameWare NT Utilities, one need not install a piece of client software first – it just works. Technically, it does install a piece of client software, but this is done through the Windows Service Scheduler and is uninstalled when you log out – effectively, there’s no client software necessary.
Thanks to recent improvements in Samba 4, however, this is now possible to do from a Linux box. A very capable programmer, using the current codebase of Samba 4, has put together winexe. Winexe is exactly like psexec (as far as I can tell), except that it’s open source, and works from Linux, making it a very valuable tool for any system administrator who runs Linux on his own machine.
The usefulness of such a program is near limitless: you can remotely install a VNC server with a preset password on Windows boxes, essentially deploying a DIY virtual desktop environment, or you could use it to edit registry entries (through regedit.exe’s CLI). Note that if you merely want to grab file listings of a remote computer, the more conventional smbclient will do you well.
Is this useful to you? Do you know of other tricks or tools for administering Windows computers from a Linux machine? Share your knowledge in the comments below.
Tagged: administration, cli, linux, psexec, pstools, windows, winexe