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 an application which performs some logging and reporting, and it has to stay running continually in order to function (the developers haven't heard of Windows services, evidently). Normally we just leave them running in a disconnected Remote Desktop session so that we can connect remotely to check stats, reports, etc. It works well enough.

When the server reboots, however, these applications aren't automatically started. This can be a problem, since the data that's being logged is highly temporal in nature, and comes from a different server. Is there some way to have this logging server automatically log in to a disconnected RDP session at startup? I've done automatic console logins before, but never RDP. If that's possible, then I can just put the necessary programs into Startup.

Edited to add:

One of the various application-to-service conversion wrappers might work, but we specifically want to keep the interface available for whenever somebody connects to work with the program. It's just that it also has to stay open even when nobody is actively using it, and when the server reboots, such as to apply OS updates, the program isn't restarted automatically.

share|improve this question
    
I see no problem. Make a automatic console login with the program in startup. If you use the very same credentials via rdp and you force to use the console connection, you grab this running session. It's not a ideal solution, but i runs. With the /admin parameter at the commandline of mstsc.exe you connect to the concole session. This parameter should version agnostic, so you will verify that via mstsc /? on your client machine. –  f4m8 Nov 14 '11 at 14:06
1  
There's no console session (for interactive session 0 connections) in W2K8. blogs.msdn.com/b/rds/archive/2007/12/17/… –  joeqwerty Nov 14 '11 at 18:14
    
Hmm, I had totally forgotten that there's no more console session. Thus I may be able to do the standard auto-login registry hack, then connect to that session as though it were a standard remote session. I can't take the server down mid-day to test this, so I'll have to wait until after hours. –  db2 Nov 14 '11 at 18:45
add comment

6 Answers

up vote 1 down vote accepted

One of the elements of our phone system has a very similar issue.

Assuming 2008 is like 2003 You can do an automatic console login to start your applications and connect to that existing session via RDP remotely once it is running. Not ideal but functional.

@Bart's solution is really the best route to go if you can make it happen. The phone system issue I mentioned had some weird GUI hook issues that stopped that from working in my case.

share|improve this answer
    
Turns out this works even better on 2008 since there's no "console" session anymore. I did the usual auto-login registry hack, and the machine logs in at the console when restarted. But since it's not a special "console" session, remote desktop connections will take over that session normally if using the same login. Hooray! I can live with that. –  db2 Nov 16 '11 at 13:11
add comment

Google for something like "run program as service windows 2008" and you'll find a number of programs that will run an executable as a service. It may be clunky and you'll have to test it to see if it's compatible with your application, though, since the your program was designed to run like that. No telling how it'll react to not having a console to display to...but if it will run as a service it's probably better than leaving an RDP session running.

Really you're kind of trying to crowbar something to fit into a function it wasn't designed for; Windows wasn't meant to run RDP sessions just to run a particular application when starting the session, and to my knowledge there isn't a way to get it to do so.

Another alternative would be to have a monitoring program running on another system that could "ping" the server for the existence of a particular service, or have a batch/script file run at bootup time that would send an alert that the server restarted so someone can log in and start up the RDP session. If you have system monitoring services in place that can detect uptime or the existence of a particular process on the server that may be your best workaround.

share|improve this answer
    
No good, I'm afraid. We need the program to run interactively, since it has various reporting/administrative functionality that will be used occasionally throughout the day. Otherwise I probably would just take the service wrapper approach. –  db2 Nov 14 '11 at 18:50
    
Ugh...I hate programs like this. We have one similar...makes me wonder what the developers were thinking. –  Bart Silverstrim Nov 14 '11 at 19:12
    
At least it's not as bad as the one we used to have that was a DOS program running on an unpatched Win2K machine at a domain admin console. I'll leave the fallout of that one to your imagination. –  db2 Nov 16 '11 at 13:06
add comment

You could try creating an automated task with Task Scheduler. Under the Trigger tab, you could choose "At Startup". Also, under the General tab, you can choose which user the process will run as. Another thing you could try is under the Settings tab, you have the option if restarting the task if it fails.

share|improve this answer
add comment

I would try FireDaemon! http://www.firedaemon.com/

share|improve this answer
4  
Maybe add a bit more detail rather than just a link? –  TylerShads Nov 14 '11 at 18:56
add comment

We do this on a clients server running win 2008r2 and have no problems. Its virtualized so getting to the console it pretty easy. The app has to run interactively and doesn't work as a service at all... for one thing it doesn't respond to normal windows shutdown instructions and will block a system shutdown until you intervene manually.

MS have a tool called autologon.exe available from www.sysinternals.com

It works fine. After you autologon you just have a normal entry in the startup folder.

I have to agree with the above comment that this is not a great idea - but when you are faced with an app which has to be open to work then you don't have much alternative. Best you can do is complain about it to the developers.

share|improve this answer
add comment

Have a look at Autologon from Sysinternals: http://technet.microsoft.com/en-us/sysinternals/bb963905

share|improve this answer
add comment

Your Answer

 
discard

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.