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

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.
0
AhmedAliShaik
Asked:
AhmedAliShaik
  • 3
  • 2
1 Solution
 
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

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

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