Solved

Auto Logoff Windows 2003 Terminal Server Users at Certain Time

Posted on 2008-10-23
2
1,267 Views
Last Modified: 2013-11-21
Hi Guys,

I have Windows 2003 Terminal Server, users connecting through thin client to this server. Our 2nd shift finishes at 2:00am and I want all users to be logged off from the server. Most of the user disconnect their session inplace of logging off.

What I need is to logoff all active users other than "Administrator" at 2:00am.

I m aware of to set idle session & disconnected session time limits and don't want to use that approach as the users complain about termination of their sessions

Thanks for your help

Gill.
0
Comment
Question by:pjsgill
2 Comments
 
LVL 31

Accepted Solution

by:
Henrik Johansson earned 125 total points
ID: 22804470
Copy the code snippet into notepad and save it as logoffsessions.cmd and create a scheduled task that execute the script at the given time.
for /F "tokens=3" %%a in ('quser^|find /v "USERNAME"^|find /v /i "administrator"') do rwinsta %%a

Open in new window

0
 

Author Closing Comment

by:pjsgill
ID: 31509235
Thanks, it worked for me
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some time ago I faced the need to use a uniform folder structure that spanned across numerous sites of an enterprise to be used as a common repository for the Software packages of the Configuration Manager 2007 infrastructure. Because the procedu…
Learn about cloud computing and its benefits for small business owners.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question