Time Server Extension Attribute

CJohnson1788
New Contributor

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?

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor III
#!/bin/zsh

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

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

View solution in original post

2 REPLIES 2

mm2270
Legendary Contributor III
#!/bin/zsh

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

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

CJohnson1788
New Contributor

Outstanding! That works perfectly. Thank you very much!