Linux – Monitor Windows Terminal Sessions from Linux/Mac

linuxrdpremote desktopwindows-server-2003

I'm writing some scripts to make remote connections to a Windows 2003 server a bit more user-friendly, and in doing this I want to see who's logged in already. In Windows, I could use qwinsta.exe to do this, even for remote servers. So it is exposed somehow, but I couldn't find a matching command line tool for Unix.

Lacking such a tool, I could install an ssh server on the machine and call it remotely, parsing the output or write a small service of my own that would expose this via http, if I don't want full-blown ssh access.

Do I have to do this, or is there already a tool for querying terminal services remotely?

Best Answer

If you want a simple command line access to the windows server,
there is freeSSHd for that.

It will allow you to login to the Windows Server using your ssh client and run commands remotely. You can then run qwinsta.exe and use its output.