Terminate A Session Using A Programmed Task

JORGEMAL

Active Member
Joined
Apr 30, 2011
Messages
27
Location
Mexico
I have a batch file to terminate a Windows Server 2008 session and it works fine. I also created a programmed task so it runs automatically around midnight but, when I go to our server in the morning, the session is still active and Windows is only blocked. As all of you must know, Windows Server 2008 blocks itself after some time has elapsed and no activity has been performed. Well, at the time my programmed task runs, Windows is already blocked and for this reason the session stays alive but, if it is not blocked yet, then the session is termiated when the programmed task runs. How can I solve this issue so the Windows session is terminated wheather it is blocked or not.

With respect,
Jorge aldonado
 
ICTCity said:
In scheduled task you have one option "run this task even if user is disconnected" or something like that.
I had already tried this option before without result, and I guess it does not apply to my case. The reason I say that it does not apply is because a session is open all the time because I do not logout, all I do is to finish my work in the server and leave, I do not logout. After a period of time has elapsed, Windows Server 2008 blocks itself (but the session remains), and it is this situation which (I think) avoids the session to terminate when the programeed task runs the batch file.
 
ICTCity said:
Can u post your batch file content? It looks like the batch misunderstand the computer status.
The batch file has only a "shutdown /l" command, nothing else. Such a batch file runs fine when executed directly. Also, I found that there is a "0x1" error in the programmed tasks for this task. I tried several things like the ones in this site http://social.technet.microsoft.com/Forums/en-US/winserverManagement/thread/57c65328-d8c8-4e13-9b51-e017ae6c298c without success.
 
Try this:

use the SYSTEM account, check run with highest privileges and still with run also if user is not logged on.

if this doesn't work, the try to add /f to your batch.

also check if the user as the privilege"log in as a script"
 
Back
Top