Powershell script to reboot a server

I need a powershell script to reboot couple of servers every week by running it as a scheduled task and in the event viewer it should record a message like "As per weekly maintenance server is rebooted".

We have a jump server with 2008 servers, and the servers which we need to reboot are 2003 servers.
LVL 2
AhmedAliShaikAsked:
Who is Participating?
 
AkulshCommented:
Why don't you schedule a simple old-fashioned batch file (*.bat) with contents like:

C:
cd\
Shutdown /r /f /c "As per weekly maintenance server is rebooted"


Using Powershell for this simple task seems overkill to me.
0
 
AhmedAliShaikAuthor Commented:
Akulsh its good & working perfectly.
0
 
AhmedAliShaikAuthor Commented:
Thanks.
0
 
AkulshCommented:
If it is working perfectly, why did you not give grade of Excellent?

In your grade of the previous question, I think Qlemo told you to give 'good' grade only when answer is not complete and you have to do some of your own research. Apparently you ignored his advice.
0
 
AhmedAliShaikAuthor Commented:
Thanks JARmod101 ,

Really i am not aware of the grading system.

Akulsh i am really sorry.
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.