W2K Terminal Server Disable at set time

Posted on 2006-05-25
Last Modified: 2012-08-14
We are currently running a Windows 2000 terminal server. I would like to disconnect any users (that are connnected) at specific time (like right before we run a backup of the server). Is this possible to do with windows 2000 TS? Please provide specific steps if it can be done.
Question by:NTNBower
    LVL 2

    Expert Comment

    If you don't mind doing a reboot, scheduling a scheduled task:
        tsshtdn /reboot
    will reboot - which very effectively gets users off !

    If you don't mind  a bit of programming, you could create a batch file to :
    - QUERY USER  output to a file.
    - A program to process that file and create another batch file that runs
      RESET SESSION  sessionid
      for each user logged on.

    Some useful information at

    Maybe somebody else has something better...


    Author Comment

    Well, I found a bit of help on the web that helped me come to this conclusion - Aside from showing who was connected to the terminal server prior to the backup, we also came to the conclusion that we also needed to see who (better - what process) is causing my files to be skipped. I managed to find a batch script on the internet and modified it to do the following:

    Check our network for all Terminal Servers (using the command C:\Query Termserver)
    Once all the terminal servers are found
    Loop through the servers found and lists their users and state
         (using the command C:\Query Users /Server:servername)
         loop through users found on the server above to list each users running processes
               (using the command C:\Query Process Username /Server:servername)
         next user
    next server

    All output is written to a log file LastNightsUsers.txt

    I found the script at:
    His script was capable of findiding disconnected users and loggin them off, for the time being I am going to see if I can find the culprits - if it turns out that the users are loggin off, but something in the terminal server is keeping the files open, I will look at potentially kicking everyone off before the backup.

    Accepted Solution

    PAQed with points refunded (250)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now