I'm happy to see bootstrap token support in Jamf 10.19, but I only want to run profiles install -type bootstraptoken
for users that don't have a token escrowed. I couldn't find an existing EA here to help scope my policy, so I put one together. Hopefully someone finds this useful :)
#!/bin/bash
tokenStatus=$(profiles status -type bootstraptoken | awk '{ print $7 }' | sed 1d)
if [ $tokenStatus == "NO" ]; then
echo "<result>Not escrowed</result>"
elif [ $tokenStatus == "YES" ]; then
echo "<result>Escrowed</result>"
else
echo "<result>Unknown status</result>"
fi