Powershell script to reboot a server

Posted on 2012-09-14
Last Modified: 2012-09-18
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.
Question by:AhmedAliShaik
    LVL 3

    Accepted Solution

    Why don't you schedule a simple old-fashioned batch file (*.bat) with contents like:

    Shutdown /r /f /c "As per weekly maintenance server is rebooted"

    Using Powershell for this simple task seems overkill to me.
    LVL 2

    Author Comment

    Akulsh its good & working perfectly.
    LVL 2

    Author Closing Comment

    LVL 3

    Expert Comment

    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.
    LVL 2

    Author Comment

    Thanks JARmod101 ,

    Really i am not aware of the grading system.

    Akulsh i am really sorry.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    A commonly asked question on the site recently has been regarding how do I share the GAL between different forests? I want a list of Contacts representing all the users in a remote domain, How do i get them? It's a problem I was posed with a litt…
    "Migrate" an SMTP relay receive connector to a new server using info from an old server.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 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

    11 Experts available now in Live!

    Get 1:1 Help Now