I am trying to setup an extension attribute that will report wether the current user's SecureToken is enabled or disabled. Here is where I am right now. I want it to just report a Disabled or Enabled and then I can have a smart group based on that criteria that will run a script to enable it for the current user.
#!/bin/bash
# Get the Username of the currently logged user
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`
# Get SecureTokenStaus
status=$(sudo sysadminctl -secureTokenStaus "$loggedInUser")
echo "<result>$status</result>"