Solved

Auto Logoff Windows 2003 Terminal Server Users at Certain Time

Posted on 2008-10-23
2
1,269 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Know what services you can and cannot, should and should not combine on your server.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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