Russ Sparks
01-19-2007, 09:23 AM
Hello, I need a way to logff all users connected to terminal services (2003 R2) from a command-line. Anyone know of a way? Thanks for your help
|
Click to See Complete Forum and Search --> : Logoff all users connected to terminal services Russ Sparks 01-19-2007, 09:23 AM Hello, I need a way to logff all users connected to terminal services (2003 R2) from a command-line. Anyone know of a way? Thanks for your help gunderstone 01-24-2007, 11:20 AM How about - http://technet2.microsoft.com/WindowsServer/en/library/2955fe3f-747e-46a6-8825-eb9eb7baacae1033.mspx?mfr=true Logoff.exe: Logoff Category This tool is included in all Windows Server 2003 operating systems and in all Windows XP operating systems. Version compatibility This tool will run on all Windows Server 2003 operating systems and on all Windows XP operating systems. Logs off a user from a session and deletes the session from the server. You can always log off from the session to which you are currently logged on. You must, however, have Full Control permission to log off users from other sessions. Logging off a user from a session without warning can result in loss of data at the user’s session. You should send a message to the user using the msg command to warn the user before taking this action. If no ID or name for the session is specified, logoff logs off the user from the current session. If you specify a session name, it must be an active one. When you log off a user, all processes end and the session is deleted from the server. You cannot log off a user from the console session. Russ Sparks 01-24-2007, 11:30 AM Thank you for your reply. Unfortunately with that tool you need to know the username or session id. I need a way to logoff all users, at once gunderstone 01-24-2007, 11:35 AM Do you need to do this gracefully or not? You can slam the service shut which will knock everyone off but that could cause a loss of work Russ Sparks 01-24-2007, 11:40 AM I've tried doing a restart of the Terminal Services service but I get an access denied (I'm full administrator), so something's blocking it. I don't mind it being abrupt, the users have been told time and time again to logout, maybe they'll learn a lesson if they lose some data. (it's just a couple of users that keep not logging out, even with the threat of physical beatings :) ). I've tried group policy to idle timeout log them out but for some reason the server continues to see them as active (even after they've been gone for hours) so that never hits. gunderstone 01-24-2007, 02:23 PM There are some other items you can set via group policy that you might try. As a quick overview I would just look at http://technet2.microsoft.com/WindowsServer/en/library/ce7a0f28-83ac-4d88-909f-b25eea12b9c51033.mspx?mfr=true Configuring Terminal Services with Group Policy to make sure you haven't made a simple error in assigning the policy(ies) you're trying to enforce. How to apply Group Policy objects to Terminal Services servers at http://support.microsoft.com/kb/260370 is a good review too as well as http://technet2.microsoft.com/WindowsServer/en/library/ae1fbb95-eb16-4ea6-ba8c-6ca7d60b5f181033.mspx?mfr=true Managing Terminal Services users with Group Policy You should be able to set an Active session limit and / or set Session limit behavior as well. http://technet2.microsoft.com/WindowsServer/en/library/c800698b-d5ce-4e71-aba6-3d3a5d3440b11033.mspx?mfr=true has some additional information on this In the meantime I'll try to figure out another way to knock live sessions down for you Russ Sparks 01-24-2007, 02:26 PM Thanks alot for your help. I'll check out those resources and see what I can come up with. The problem I've found with the active session limit is the times you can set, they're either too short or too long. I'll look at those. Thanks again Serverwatch.com
Copyright Internet.com Inc. All Rights Reserved. |