Shutdown a machine from a remote machine that does not have permissions

Posted on 2007-10-21
Last Modified: 2010-04-16

I want a script that pops a cmd prompt asks for the machine name then username & password.TO authenticate the remote machine then shut down the machine no matter what applications are open.Force shutdown.
Question by:bsharath
    LVL 33

    Accepted Solution

    First create a batch file to shut down the server.  Here is the content of your batch file:

      shutdown /r /f /c "Planned Shutdown." /m \\servername

    Then use runas to run your batch file:

      runas /user:domain\username  yourbatch.bat
    LVL 33

    Expert Comment

    oops, but change the  /r   to   /s   instead
    LVL 11

    Author Comment

    Any way to ven put the Runas code in a bat file.?
    If i need to shut down more than 1 machine how do i go...
    LVL 33

    Expert Comment

    You can put more than one shutdown command in the batch file:

      shutdown /s /f /c "Planned Shutdown." /m \\servername_1
      shutdown /s /f /c "Planned Shutdown." /m \\servername_2
      shutdown /s /f /c "Planned Shutdown." /m \\servername_3
      shutdown /s /f /c "Planned Shutdown." /m \\servername_n
    LVL 33

    Expert Comment

    yikes!  that just looks scary.  

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
    The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

    761 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

    12 Experts available now in Live!

    Get 1:1 Help Now