Posted on 09-08-2022 12:52 PM
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?
Solved! Go to Solution.
Posted on 09-08-2022 01:06 PM
#!/bin/zsh
time_server=$(/usr/sbin/systemsetup -getnetworktimeserver | /usr/bin/awk '{print $NF}')
/bin/echo "<result>$time_server</result>"
Posted on 09-08-2022 01:06 PM
#!/bin/zsh
time_server=$(/usr/sbin/systemsetup -getnetworktimeserver | /usr/bin/awk '{print $NF}')
/bin/echo "<result>$time_server</result>"
Posted on 09-08-2022 02:24 PM
Outstanding! That works perfectly. Thank you very much!