Skip to main content
Solved

Time Server Extension Attribute

  • September 8, 2022
  • 2 replies
  • 34 views

CJohnson1788
Forum|alt.badge.img+4

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?

Best answer by mm2270

#!/bin/zsh time_server=$(/usr/sbin/systemsetup -getnetworktimeserver | /usr/bin/awk '{print $NF}') /bin/echo "<result>$time_server</result>"

2 replies

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • 7886 replies
  • Answer
  • September 8, 2022
#!/bin/zsh time_server=$(/usr/sbin/systemsetup -getnetworktimeserver | /usr/bin/awk '{print $NF}') /bin/echo "<result>$time_server</result>"

CJohnson1788
Forum|alt.badge.img+4
  • Author
  • New Contributor
  • 3 replies
  • September 8, 2022

Outstanding! That works perfectly. Thank you very much!