Created
September 30, 2025 15:26
-
-
Save rjhornsby/b3722387e86f60296e78af4ae5f4ab7b to your computer and use it in GitHub Desktop.
Get CAC/PIV UPN on macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| system_profiler SPSmartCardsDataType | grep -A5 '#04: Kind: private RSA' | tail -n3 \ | |
| | openssl x509 -noout -text | grep -o 'UPN:.*,' | awk -F'[:,]' '{print $2}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment