Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a daily procedure when operator logs on via RDP to Windows hosts to ensure the operation is successful so other users can logon at the later stage and to their work.
Putting aside question why this is done this way, is it possible to automate this procedure?Can it be scripted?
Logically the procedure is getting expected output from the operation so it must be possible to automate it using some combination of tools. I can think about AutoIT and powershell to start with.
Has anyone came across this ( unusual ) request before? The check could then be ran as part of monitoring framework (Zabbix, Nagios, SCOM)

share|improve this question
doesn't scom have a managment pack for this, would think that both zabbix and nagios would also have this somewhere. –  tony roth Apr 5 '13 at 16:36
Hi Tony, if you have a link for any of these, this would constitute as an answer ;) –  Sergei Apr 5 '13 at 16:50
don't know if RDP virtual channels could be used for this but take a look at msdn.microsoft.com/en-us/library/windows/desktop/… –  tony roth Apr 5 '13 at 17:23
so the answer is that there is no builtin mp for rdp from scom but I'd think the above links would give a start as to a scriptable interface. –  tony roth Apr 5 '13 at 17:27

1 Answer 1

If I were going to script this I'd look at using an RDP client to connect to the server, authenticate, and execute a program that emits some kind of machine-readable "flag".

Using the Microsoft RDP client, you could create an RDP parameter file with the alternate shell:s: setting set to run a script that touches a flag file and performs a logoff should be sufficient. Saving credentials is going to be your biggest pain.

I found an article with some discussion about using the free rdesktop client to do this which would be feasible to do from a non-Windows based monitoring machine.

Actually, you could even look at putting a script in the the user's "Startup" folder and using the scripted logon to "exercise" explorer.exe, too. That might be an even better way than using the alternate shell functionality. You'd want some timeout functionality to detect a hung session and kill the RDP client (along with alerting a failure). You wouldn't want to start stacking-up a bunch of hung RDP logons.

share|improve this answer
Awesome.I will read about it and comment later. Thanks a lot Evan. –  Sergei Apr 5 '13 at 16:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.