• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

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

Hi,

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.
Regards
SHarath
0
bsharath
Asked:
bsharath
  • 4
1 Solution
 
knightEknightCommented:
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
0
 
knightEknightCommented:
oops, but change the  /r   to   /s   instead
0
 
bsharathAuthor Commented:
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...
0
 
knightEknightCommented:
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
0
 
knightEknightCommented:
yikes!  that just looks scary.  
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now