Bootstrap token extension attribute

sshort
Valued Contributor

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
10 REPLIES 10

dng2000
Contributor II

@sshort Thanks for sharing your script for this. :)

swapple
Contributor III

Thanks!!

Duran
New Contributor II

Great 👍

A-bomb
Contributor

Just what I was looking for! Thank you 😀

AquibS
New Contributor

what do you mean by "unknown status"

Frank_Sonder
Contributor

Doesn't seem to work on Monterey

12.3? Works fine for us on 12.0–12.2.1.

Maybe I'm doing something wrong... It's blank.

Screen Shot 2022-03-14 at 2.52.31 PM.png

ok never mind, it just takes time to appear. Thx

engh
New Contributor III

Is there a feature request to USE THE BUILT IN INVENTORY ITEM as a searchable criteria in either smart group or advanced search?

Seems ludicrous that we need to create an EA for something that is already reported in the inventory of a computer.