Schedule a Login on Windows Server?

Is it possible to schedule a login on a server? By that I mean, if I scheduled a server to shutdown and reboot at a certain time, is it possible to then have it log itself back into the console at another certain time?
street9009Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

piattndCommented:
Are you logging in with local or domain credentials?
0
street9009Author Commented:
Domain
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

street9009Author Commented:
Well it's a little more complicated than that. I need to wait until a certain time to do it, not just have it log in when it boots.
0
piattndCommented:
What you're talking about doing just got a little less realistic and a lot more complicated.

If you don't want to use the suggested method of Reghack, you'll have to develop a piece of software that can delay however long you want it to delay, then issue the keystrokes simulating an actual person logging in.  This isn't easy, because you cannot use sendkeys, as there's no process to attach to.

What is your reason for the time delay?
0
street9009Author Commented:
Timing basically. All servers need to be on and at a login console before they can be logged in. Long story.
0
piattndCommented:
You can try something like this program, but use it at your own risk.  I have not used it and cannot confirm whether it contains any sort of key logging or anything like that.

http://mwganson.freeyellow.com/winkeysim/

You would have to see if there is a command line to this tool that will allow you to execute a macro that you've created for logging in and kick that off via login script.  Because you want to wait, you'll need to use their pause mechanism to wait that amount of time until you wish to login.

Please understand this is an extremely unstable and unpredictable setup.  There is no guarantee all the servers will be at the login screen and login at the same time.
0
street9009Author Commented:
Understood. I'll keep that in mind.

However- I don't see how I can use that program to initiate the login. That's what I'm trying to do. So basically at a high level:

1. Shut down applications and reboot servers in a certain order (at certain times with enough time in between each- do one at 2am, another at 2:15am, etc.)


2. Log servers in once sufficient time has passed for all to reboot and come up to a login prompt (say starting at 2:40am)


3. Begin starting applications programmatically after successful login


Step 2 is really the only part I'm hung up on. While Steps 1 and 3 won't be simple (will need to be very delicate and test test test, obviously) I'm pretty sure I can handle them.

Does that make sense?
0
namolCommented:
You could use Autohotkey to automate this task but I do have a question as to why all servers must be at a login prompt before you can login?
0
piattndCommented:
You could have a script that runs at startup.  The script would need to check the current system time and execute the command at the appropriate time that would simulate the login.  You'd also want to make sure there were no sessions currently established, as you wouldn't want to login if you're already logged in.
0
street9009Author Commented:
Interesting. Okay I'll give that a shot.

namol- it's a long story. Suffice it to say they communicate with one another a lot and don't take kindly to being logged in if one or the other isn't there.
0
namolCommented:
Haha, gotta love the greatness of some programs. I've also used logon to help automate some tasks, the website is http://www.softtreetech.com/24x7/archive/51.htm. You can have it run as a scheduled task to login the user at a certain time.
0
David Johnson, CD, MVPOwnerCommented:
I'm confused as many of my servers no user is ever logged into the console. All the server functions work just fine..

With namol's solution above, you'd need some way of triggering the scheduled task. or use a scheduled task to start the program at a specific time.. or a loop that check for the existance of a file, if found run logon.exe and delete the trigger file else wait 1 minute loop back to beginning.
0
street9009Author Commented:
namol- that looks like an excellent program. I've written a batch file to call the program but it doesn't appear to be executing. The task history says it launched and completed, but my results.txt is empty. Here's the code in the batch file:

@echo off
C:
cd \
cd Batch
Logon.exe -u <USER> -p <PASSWORD> > results.txt

Open in new window


If I run the task manually, results.txt gets the output (reports that the computer isn't locked) but I get nothing when the server I'm testing with is logged out.

Any ideas?
0
namolCommented:
Is the server you're trying on 2008 r2 or is it 2012? I have not used the program on 2012 so I am not sure how it handles logins since the login interface is different on 2012.
0
street9009Author Commented:
The one I'm testing on is 2008 R2, but I do have some 2012's I'll need to run it on as well.
0
street9009Author Commented:
Okay it seems I finally got it to run when logged out but I'm still getting the following (locked or logged out):


Windows Logon version 1.04
Copyright (c) 2003-2010 SoftTree Technologies, Inc.

Computer is not locked. Nothing to do!
Run this program only when your computer is locked.
0
street9009Author Commented:
Going to answer this one myself. Finally found a decent utility (though it must be purchased): http://www.logonexpert.com/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
street9009Author Commented:
Logon expert does exactly what I was looking for. None of the other suggestions did.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Server OS

From novice to tech pro — start learning today.