Skip to main content

I'm trying to create an extension attribute to show what time server is configured on our Macs. This should make it easier to show an auditor that we manage the time server on endpoints. Does anyone know of a terminal command that would output a machine's time server?

#!/bin/zsh

time_server=$(/usr/sbin/systemsetup -getnetworktimeserver | /usr/bin/awk '{print $NF}')

/bin/echo "<result>$time_server</result>"

Outstanding! That works perfectly. Thank you very much!