Tuesday, 26 June 2012

#Windows Task Scheduler - How to schedule Windows 7 or 2008 r2 restart or shutdown automatically

Create a .bat file 

1. Open new notepad, type c:\windows\system32\shutdown -r -f -t 10

      *For shutdown change -r  to -s
      

* -r : restart
* -s : shutdown
* -f : force all running application exit/terminate
* -t :specifies the countdown time(seconds) until the shutdown

2. Save the notepad as .bat file.

3. Go to Computer --> Manage --> right click Task Scheduler --> Create Task

4. In General, put a Task Name, set a user account running the task, configure for windows 7/windows server 2008 r2

5. In Triggers, click new

6. Set the schedule restart or shutdown time, click OK

7. In Actions, click new

8. Action as Start a program. Browse the created .bat file, click OK

9. Click OK.

Wednesday, 6 June 2012

Windows 2008 R2 - Synchronize time with external NTP server

1. On PDC server , stop the W32Time service , run command prompt as administrator, type net stop w32time

2. Configure the external time source, type w32tm /config /syncfromflags:manual /manualpeerlist:"net server"

    Example: w32tm /config /syncfromflags:manual /manualpeerlist:"my.pool.ntp.org"



3. Make PDC a reliable time source for the client, type w32tm /config /reliable:yes


4. 
On PDC server , start the W32Time service, type net start w32time

5. To check the status of your current time server settings, type w32tm /query /status

6. To display the configuration of run-time and where the setting come from, type w32tm /query /configuration