I know of a cert that will be expiring on macs in the enviroment . The cert is user based and is called "username" only
I have an extension attribute which works beautifully, however it's only showing me a result from another cert called "username@somewhere.com" instead of the cert named "username"
Anyone know how I can ensure that the result is for the cert called "username" only ?
The EA is as follows
!/bin/bash
This extension attribute finds the expiry date of a certificate with the same name as the user account.
loggedInUser=/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'
Get Cert Expiry Date
certexpiry=sudo -H -u $loggedInUser bash -c "security find-certificate -c $loggedInUser -p" | openssl x509 -text| grep "Not After :"| awk '{print $7"-"$4"-"$5}'
echo "<result>$certexpiry</result>"
