win2k,2k3 script command to reboot users??

Posted on 2005-05-09
Last Modified: 2010-04-10
we have a customer who cannot manage to make the network users logout of our application.  we are redoing some parts of it and occassionally need to have all users out while we update programs or data.  the wee hours of the nite when they are closed would work for this if we were onsite.  however, we are accessing remotely.

their administrator knows how to lock the users out of the network between say 10pm & 4am, but doesnt know how to make sure the users are out of our application then.  unless someone runs around and physically checks this.

at another site i put program on the users (winoff) that will force a reboot at a programmed time and this works fine.

it has been suggested to us that the windows network management software may have some command that can be issued to the users to do the same thing (or maybe do a logout and close all running programs).

anyone know how this could be done as a centralized operation rather than individually on each user?


Question by:jsturtz
    LVL 8

    Expert Comment

    First question we're going to ask is what are the clients OSs?
    LVL 10

    Expert Comment

    From a Windows XP command prompt you can run the "shutdown" command. Also has a GUI mode..

    C:\>shutdown /?
    Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]

            No args             Display this message (same as -?)
            -i                      Display GUI interface, must be the first option
            -l                      Log off (cannot be used with -m option)
            -s                     Shutdown the computer
            -r                     Shutdown and restart the computer
            -a                     Abort a system shutdown
            -m \\computername       Remote computer to shutdown/restart/abort
            -t xx                              Set timeout for shutdown to xx seconds
            -c "comment"                Shutdown comment (maximum of 127 characters)
            -f                      Forces running applications to close without waning
            -d [u][p]:xx:yy         The reason code for the shutdown
                                    u is the user code
                                    p is a planned shutdown code
                                    xx is the major reason code (positive integer lss than 256)
                                    yy is the minor reason code (positive integer lss than 65536)

    LVL 1

    Author Comment


    thanks for the quick reply on the local shutdown.

    do you know of a way this can be told to run via the win2k/win2k3 administrative software, or must it be put on each computer.  i presume as a task for the scheduler.  

    as this is a native windows program is it any better/worse for doing a shutdown compared to commercial/shareware/freeware programs like WinOff, or do they merely have more options wrapped around them?


    LVL 8

    Expert Comment

    You aren't reading the experts responses.

    Question:  What OSs are the clients, because there IS an easy answer for XP, which Sean just told you.  Using the propper switch performs a remote shutdown.

         -m \\computername       Remote computer to shutdown/restart/abort
    LVL 10

    Accepted Solution

    Use the AT Command to Schedule Tasks to remotely shutdown those machines..

    or Server Side


    For Win2k, the switch options are different :;en-us;317371

    shutdown \\computername /l /a /r /t:xx "msg" /y /c

    \\computername: Use this switch to specify the remote computer to shut down. If you omit this parameter, the local computer name is used.

    /l (Note that this is a lowercase "L" character): Use this switch to shut down the local computer

    /a: Use this switch to quit a shutdown operation. You can do this only during the time-out period. If you use this switch, all other parameters are ignored.  

    /r: Use this switch to restart the computer instead of fully shutting it down.

    /t:xx: Use this switch to specify the time (in seconds) after which the computer is shut down. The default is 20 seconds.

    "msg": Use this switch to specify a message during the shutdown process. The maximum number of characters that the message can contain is 127.

    /y: Use this switch to force a "yes" answer to all queries from the computer.

    This is one you are looking for =)

    /c: Use this switch quit all running programs. If you use this switch, Windows forces all programs that are running to quit. The option to save any data that may have changed is ignored. This can result in data loss in any programs for which data is not previously saved.

    LVL 1

    Author Comment


    thanks for the followup, and clarification.


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    How to access an IP camera remotely 25 98
    good comptia a+ teacher? 4 51
    IPV6 and AWS 3 24
    CCTV Installation - Networking 3 21
    Even if you have implemented a Mobile Device Management solution company wide, it is a good idea to make sure you are taking into account all of the major risks to your electronic protected health information (ePHI).
    Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    728 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

    21 Experts available now in Live!

    Get 1:1 Help Now