SCRIPT to reboot WINDOWS 2008 server with scheduled task

Hello,

I need a script to reboot windows 2008 server with scheduled task.

Thanks
cawasakiAsked:
Who is Participating?
 
farazhkhanCommented:
Hi,

There is a command line tool that comes with Windows Server 2008 -- so you don't need any 3rd party or resource kit tools.

You can simply put something like this into batch file:

shutdown -r -t 60

-r is for reboot
-t is in how many seconds (60 seconds)

Name the batch file something like "reboot.bat". Now set up schedule just like you would for any other task and call that batch file at convenient time.

Regards,
Faraz H. Khan
0
 
lofCommented:
you may reboot you server with a command

shutdown -r

you may schedule such task
0
 
nergikCommented:
Do you just want to reboot the server at a specified hour ?  or do you need to check if some process are running and wait for them to rebook?

Btw, why do you need to do that? if you can explain us a little bit more the problem maybe theres a better solution for it
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
malcouCommented:
I agree with lof and farazhkhan use shutdown comand - but I would add the -f parameter which forces shutdown even if there is a popup box on the screen waiting for an answer.
If you want to run this from another computer you could create a bat file with the following line and schedule it from there

shutdown -r -f -t 60 -m \\windows2008server

The Task Scheduler in 2008 can be found under Administrative Tools

0
 
cawasakiAuthor Commented:
hi,

i need this because the admin of server has not  access to this server (no TSE access...), he has just right to open scheduled task mmc from remote server.

shutdown -r -f -t 60 -m \\windows2008server

==> 1-this command reboot the server properly?
2- can I execute this command from remote server on cmd prompt?

Thanks for your help
0
 
nergikCommented:
hello,
but the remote admin doesnt have acces to the server because you set up explicit rules acessing it or becauae there's connectivity problems/firewalls,etc? if this is the case i will suggest installing a simple remoting app like teamviewer.com on the host, and then the remote user would be able to easily connect and reboot the server on demand with a single click
0
 
malcouCommented:
You can execute this command on a remote server if the user you execute it with has local administrator rights on the server, or at least the rights to shutdown the server.
You can check this in the local security policy under Administritive tools. Check under Local Policy/User Rights assignment/Shut down the system
If this is not possible you must run it on the local machine with a local administrator
0
 
cawasakiAuthor Commented:
Hi,

Yes the user is a local administrator of server.

I have setup a gpo to block tse session on server!

Ok, i try to execute this command from remote server:

shutdown -r -f -t 60 -m \\windows2008server

Thanks
0
 
lofCommented:
Was the problem resolved or do you still need help on that one?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.