Kaseya Community

TIme Sync

  • Does anyone have a script to alert if the time on a domain workstation is off by more than 5 minutes from ther DC / Domain time?

    Legacy Forum Name: TIme Sync,
    Legacy Posted By Username: richie3333
  • No, but you pose an interesting challenge...

    Update: I might be able to do something with "time /t" and "net time" and some slice-and-dice using grep & tail. Some assumptions are going to be made, such as "there's a local DC configured to provide time to domain members," for the time being. If you'll pardon the pun.

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: GreyDuck
  • Not quite what you've asked for Smile
    however, I like to make sure all workstations and servers agree on the time, thus I run this script on them all to ensure they all stay right.

    All it does is set them all to use the same NTP server to set the time. I'm sure others can get you something closer to what your actually after.

    Ben.

    ---cut here---

    Script Name: Set NTP Servers to OCEANIA.POOL.NTP.ORG
    Script Description: net time /setsntp:"0.oceania.pool.ntp.org 1.oceania.pool.ntp.org 2.oceania.pool.ntp.org"

    IF True
    THEN
    Execute Shell Command
    Parameter 1 : net time /setsntp:"0.oceania.pool.ntp.org 1.oceania.pool.ntp.org 2.oceania.pool.ntp.org"
    Parameter 2 : 1
    OS Type : 0
    ELSE

    --end cut here---

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: benhamilton
  • Yes but anything can happen when the commands are sent. I am sure you have run into to time sync issues even after setting the time server to the same as other workstations. I simply would like to be notified if time on the local workstation is off by more than 10 minutes from the domain / DC time.

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: richie3333
  • If you monitor the event logs, any domain member should alert if it can't connect to a DC and any DC should alert if it can't connect to an external server. The inability to connect should be received well before a system has drifted by 5 or 10 minutes.

    Also a couple of notes on NTP is a domain...

    1.) Do not set specific ntp servers for anything but domain controllers....all other systems need to sync time through the domain hierarchy.

    2.) pool.ntp.org is great....much better than time.windows.com; just make sure you use the pool closest to you....I assume oceania is Australia/New Zealand/etc

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: karode
  • karode

    1.) Do not set specific ntp servers for anything but domain controllers....all other systems need to sync time through the domain hierarchy.

    2.) pool.ntp.org is great....much better than time.windows.com; just make sure you use the pool closest to you....I assume oceania is Australia/New Zealand/etc


    Agreed. Set the servers to use pool.net.org, and yes, oceania is the one I use here in AUS. Get the workstations to sync with the local server.

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: benhamilton
  • richie3333
    Yes but anything can happen when the commands are sent. I am sure you have run into to time sync issues even after setting the time server to the same as other workstations. I simply would like to be notified if time on the local workstation is off by more than 10 minutes from the domain / DC time.


    I agree, but I haven't yet found an elegant and foolproof way to do this.

    As another poster has noted, it may be effort better spent to look for event log entries which indicate the problem (domain auth issues, mainly, which you want to be looking for anyway).

    Legacy Forum Name: General Discussion,
    Legacy Posted By Username: GreyDuck