I couldn't find any extension attribute in the templates or in any forum for showing the local timezone of a computer in jamf, so I wrote my own.
It's just a simple script to pull the info from the localtime file, and cut off the first part that is always the same, then return the result to the jss.
example: TimeZone:/America/New_York
Script:
#!/bin/bash
# Extension attribute to return current TZ
localtime=`/bin/ls -n /etc/localtime`
TimeZone=${localtime:79}
echo "<result>$TimeZone</result>"
exit 0
Here's the full .XML file for importing to jamf directly:
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute>
<displayName>TimeZone</displayName>
<description>gets time zone</description>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/bash
# Extension attribute to return current TZ
localtime=`/bin/ls -n /etc/localtime`
TimeZone=${localtime:79}
echo "<result>$TimeZone</result>"
exit 0
</scriptContentsMac>
</extensionAttribute>
Feel free to use as needed!