Useless Windows Networking tip of the day: network time

Discussion in 'Windows Desktop Systems' started by Gnu, Oct 19, 2002.

  1. Gnu

    Gnu OSNN Addict

    Messages:
    129
    Something I clumsily discovered today whilst breaking various things in my network.

    I use XP's built-in NNTP client to synchronise time over the internet, but I wanted a way to synchronise the time across all of my machines, especially my 98 box, without having to run a bunch of NNTP clients and/or running an NNTP server. I tripped over Windows' NET TIME command, which apparently works on every Windows platform with networking installed!

    I simply wrote a one-line batch file:
    net time \\gnu01 /set /yes

    ... where gnu01 would be the name of the machine you're retrieving the time from. Setting the batch properties to run minimised and close on exit's a good idea, while you're at it. Then just schedule a task to run your batch file (fight the urge to name your batch file time.bat, as it will likely conflict with the command interpreter's TIME function). Set it to run daily, and voila -- perfectly synched time across your network with minimal hassle. Now I have one PC retrieving the time across the internet, and the rest grabbing their time from that PC.

    Now I'm wondering if I can do this in Samba, as well -- I'll have to give it a look on my Linux box later.
     
  2. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    Very nice tip Gnu :)
    Thanks!
     
  3. JJB6486

    JJB6486 Retired Mod Political User

    Messages:
    1,207
    Location:
    West Lafayette, IN, USA
    Yea, I've used that for a while now. A neat tip for those network admins out there, put it into your user's Domain/AD logon scripts, and install a NTP Timeserver Sync (to an internet server like time.nist.gov) on the server. That way all my client workstations are sycned to the server at logon.

    JJB