Windows Server TechCenter > Windows Server Forums > Management > Schedule for Server shutdown automatically.
Ask a questionAsk a question
 

AnswerSchedule for Server shutdown automatically.

  • Wednesday, November 04, 2009 2:50 PMmypass604 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    In windows server 2003 R2 I want that at 5 am the server should automatically shutdown. Please guide me the  complte script and how to enable it?

    thanks in advance,
    mypass

Answers

  • Thursday, November 05, 2009 2:51 AMGunner999 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Use the native windows 2003 command
    Shutdown /r /t 10 /m \\computer /c "Rebooting Server" /f /d p:4:1

    Used Control Panel -> Schedule Tasks to schedule.

    Use local administator account in the schedule task.

All Replies

  • Thursday, November 05, 2009 2:51 AMGunner999 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Use the native windows 2003 command
    Shutdown /r /t 10 /m \\computer /c "Rebooting Server" /f /d p:4:1

    Used Control Panel -> Schedule Tasks to schedule.

    Use local administator account in the schedule task.

  • Friday, November 06, 2009 9:59 AMmypass604 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    thanks Gunner99 for the reply.I used Schedule Tasks and choouse the file shutdown.exe under system32 folder with switch -r.
    The system restart with it but the question I want to ask that if the system is lock then in that case it is batter to use -I (Logg off)  switch with shutdown.exe or -r has the ability to logg off and restart/shutdown the system?

    C:\Windows\system32\shutdown.exe -s

    what is your opinion about it?

    Inshort my question is
    1-1st log off the system (If it is lock) and then restart/shutdown ?
  • Friday, November 06, 2009 2:51 PMGunner999 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    the restart switch will automatically log users off all users and shutdown the system.

    The logoff option will only log off the current user, since this is being ran as a scheduled task it is of no benefit.