User Tools

Site Tools


computing:windows:reboot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
computing:windows:reboot [2012/01/27 14:03]
gcooper
computing:windows:reboot [2017/05/06 12:00] (current)
gcooper
Line 1: Line 1:
 ====== Shut Down or Reboot a Windows Server ====== ====== Shut Down or Reboot a Windows Server ======
  
-===== Reboot Now =====+===== From Linux =====
  
-Shutdown the local machine now:+:!: Use a username with admin privileges. 
 + 
 +:!: You will need the ''samba-common'' package installed for Ubuntu. 
 + 
 +  * ''sudo apt-get install samba-common'' 
 + 
 +<file> 
 +net rpc shutdown -r -f -I xxx.xxx.xxx.xxx -U username 
 +</file> 
 + 
 +===== Do It Now ===== 
 + 
 +Reboot the local machine now:
  
 <file> <file>
-shutdown -s+shutdown -r -t 0
 </file> </file>
  
-Showing a dialog box with a timer (in seconds):+Shutdown now showing a dialog box with a timer (in seconds):
  
 <file> <file>
Line 33: Line 45:
 </file> </file>
  
-===== Reboot Later =====+===== Do It Later =====
  
 ==== Using the 'at' Command ==== ==== Using the 'at' Command ====
  
-Download and extract the [[http://download.sysinternals.com/Files/PsTools.zip|PsTools]] package from SysInternals (now Microsoft).  We extract the zip archive into C:\Support\PsTools\ as a convention.+Download and extract the [[http://download.sysinternals.com/Files/PsTools.zip|PsTools]] package from SysInternals (now Microsoft).  We extract the zip archive into ''C:\Support\PsTools\'' as a convention.
  
 Use the 'at' command to schedule a one-off reboot: Use the 'at' command to schedule a one-off reboot:
Line 62: Line 74:
  
 ==== Using the Task Scheduler ==== ==== Using the Task Scheduler ====
 +
 +=== Windows 2003/2008 ===
  
 http://www.itbox4vn.com/2011/05/how-to-schedule-windows-server-20032008.html http://www.itbox4vn.com/2011/05/how-to-schedule-windows-server-20032008.html
  
 +=== Windows 2008 R2 ===
 +
 +http://www.wegotserved.com/2011/11/04/set-automatic-scheduled-reboots-windows-home-server-2011/
 +
 +**Task Scheduler -> Action -> Create Task -> General**
 +
 +  - **Name** the task ''Scheduled Reboot''
 +  - Use the ''SYSTEM'' **user account**
 +  - **Select** ''Run with highest privileges''
 +  - **Configure** for ''Windows 2008 R2''
 +
 +**Task Scheduler -> Action -> Create Task -> Triggers**
 +
 +  - **On a schedule**
 +  - **One time**
 +
 +:!: We add two actions, one to warn users and the other to reboot the server.
 +
 +**Task Scheduler -> Action -> Create Task -> Actions**
 +
 +  - Set the **Action** to ''Start a program''
 +  - Set the **Program** to ''C:\Windows\System32\msg.exe''
 +  - Set the **Arguments** to ''* "Please log out now.  This server is rebooting in 5 minutes!"''
 +
 +**Task Scheduler -> Action -> Create Task -> Actions**
 +
 +  - Set the **Action** to ''Start a program''
 +  - Set the **Program** to ''C:\Windows\System32\shutdown.exe''
 +  - Set the **Arguments** to ''/r /f /t 300 /c "Scheduled Reboot" /d p:4:1''
 +  - Set **Start in** to ''c:\windows\system32''
 +  - Set the **Comments** to ''Reboot in 5 minutes with reason as 'Application: Maintenance (Planned)'''
 +
 +=== Windows 2012 R2 ===
 +
 +**Task Scheduler -> Action -> Create Task -> General**
 +
 +  - **Name** the task ''Scheduled Reboot''
 +  - **Use** the ''SYSTEM'' user account
 +  - **Select** ''Run with highest privileges''
 +  - **Configure** for ''Windows 2012 R2''
 +
 +**Task Scheduler -> Action -> Create Task -> Triggers**
 +
 +  - **New**
 +  - **On a schedule**
 +  - **One time**
 +  - Set the **date and time** of the desired reboot
 +  - **Stop task if it runs longer than** ''30 minutes''
 +  - **OK**
 +
 +:!: We add two actions, one to warn users and the other to reboot the server.
 +
 +**Task Scheduler -> Action -> Create Task -> Actions**
 +
 +  - **New**
 +  - Set the **Action** to ''Start a program''
 +  - Set the **Program** to ''C:\Windows\System32\msg.exe''
 +  - Set the **Arguments** to ''* "Please log out now.  This server is rebooting in 5 minutes!"''
 +  - **OK**
 +
 +**Task Scheduler -> Action -> Create Task -> Actions**
  
 +  - **New**
 +  - Set the **Action** to ''Start a program''
 +  - Set the **Program** to ''C:\Windows\System32\shutdown.exe''
 +  - Set the **Arguments** to ''/r /f /t 300 /c "Scheduled Reboot" /d p:4:1''
 +  - Set **Start in** to ''c:\windows\system32''
 +  - **OK**
  
 +:!: You can easily export saved tasks to be imported to other machines.
computing/windows/reboot.1327698190.txt.gz · Last modified: 2012/01/27 14:03 by gcooper