Windows Server 2003 How can i logoff user after certain period of time

5 pts.
Microsoft Windows Server 2003
How can i logoff user after certain period of time. not just end the session also logoff the user. Server 2003 workstation xp/200 thank you

Answer Wiki

Thanks. We'll let you know when a new response is added.

Microsoft has admitted that you can’t schedule a Windows XP-based computer to shut down and restart by using the AT command with Shutdown.exe. The reasoning is that, by default, tasks scheduled using the AT command run under the Local System account.

Shutdown.exe tries to enable certain rights before it executes the shutdown action. The Local System account doesn’t have one of the rights that Shutdown.exe tries to enable, and therefore the action is unsuccessful. Specifically, the Local System account doesn’t have the SeRemoteShutdownPrivilege right, which would enable the scheduled command to run.

Redmond’s solution is two-fold: The company advises contacting support and requesting a special fix, and it also details a workaround to the problem. In both cases, it comes down to modifying user rights.

As any administrator will tell you, this is generally a path you don’t want to go down if you can help it. However, we can solve this problem with a simple freeware utility.

Get the utility

Beyond Logic Shutdown for NT/2000/XP is a simple utility that you can schedule to run, and it will do the job every time without modifying user rights. Download the utility, and extract it into a directory. Then, follow these steps:

1. Go to Start | Run, type cmd, and press [Enter].
2. Navigate to the directory where the extracted file resides.
3. To view the different command parameters available, type shutdown /?.

Create a batch file

Using this utility, we’ll create a batch file to run that enforces our time restrictions. Follow these steps:

1. Go to Start | Run, type notepad, and press [Enter].
2. Type shutdown -s -f -c -l 30 -m “Time restrictions are now forcing you to logoff; please save all your work.”
3. Go to File | Save, and name the file Shutpc.bat, and save it in the same directory as the utility.

With this command, we’re forcing the machine to shut down, forcing applications to terminate at shutdown, preventing the user from canceling the command, displaying a message box to inform the user what’s happening, and giving the user 30 seconds to save all work.

Next, we’ll schedule the batch file to run using the built-in scheduler. Follow these steps:

1. Go to Start | Control Panel, and double-click the Schedule Tasks applet.
2. Double-click Add Scheduled Task, and click Next.
3. Click Browse, navigate to the Shutpc.bat file you just created, and double-click the file.
4. You can change the name of the task or leave it; then, select Daily, and click Next.
5. Configure the time you want to force logoff, and click Next.
6. Enter the password for the account that’s going to run this task (it should be an administrator account), and click Next.
7. Select the Open Advanced Properties For This Task When I Click Finish check box, and click Finish.
8. On the Settings tab, deselect the Power Management check box.
9. Click OK, and you’re finished!

Final thoughts

Restricting logon times is a great tool for managing home and small business security, but you’ve got to be able to force users to log off when their time is up. This utility makes it an easy process.

Discuss This Question: 2  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Denny Cherry
    Are you trying to log the user off after [i]n[/i] minutes of use, or after a specific time like 5:30 PM?
    69,130 pointsBadges:
  • Spadasoe
    Using psshutdown from Microsoft/Sysinternals, set up a scheduled task to run psshutdown when you want a user logeed off. Psshutdown has many different switches to define behavior. I have some community machines that I remotely shutdown after our weekly maintenance and it works fine. Set up the task on a machine with a list of machines that need to be shutdown/restarted/logged off.
    5,130 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: