PowerShell function to get time server NTP settings from clients

Some time ago I was asked to write a PowerShell script to do an inventory of the time server (NTP) configuration on clients.
Today I was asked the same, so I grabbed my old script, expanded it a little and here you go 🙂


  1. Shay Levy says:

    You might want to check the w32tm utility:

    w32tm /query /computer:pc1 /source

  2. Jeff Wouters says:

    That output is tricky to put into a CSV and do some selecting/sorting on it, that’s why we’v used the script I posted 🙂

  3. weiyentan says:

    Thanks for the article. Can we run it against a list of servers in a text file?

  4. Jeff Wouters says:

    Hi Weiyentan,
    Sure, you can call it like so:
    Get-TimeServer -ComputerName (get-content C:\Users\Jeff\Desktop\123.txt)

  5. Thunderlight says:

    Thanks for the script, made some adjustments to accept pipeline input but its working great

  6. Jeff Wouters says:

    Hi Marco,
    Happy to read you found it useful 🙂

  7. Wayne says:

    Hi Jeff,

    I am aa little confused how you use Get-TimeServer -ComputerName (get-content C:\Users\Jeff\Desktop\123.txt) which is what i am trying to do with this script are you able to give more detail? I am not sure how I use this script

Leave a Reply

Your email address will not be published. Required fields are marked *