How to check the expiry of digital certificates?Solved

Participant
Discussion
2 weeks ago

Hey folks, I’m stuck in a loop. I’m responsible for a bunch of devices (50-100), each with digital certificates that can expire. Checking expiry manually every time is exhausting. Anyone found a better way to handle this?

Replies (6)

Marked SolutionPending Review
Participant
2 weeks ago
Marked SolutionPending Review

Oof, yeah, manually checking that many devices sounds like a nightmare. What platform are you managing?

Marked SolutionPending Review
Participant
2 weeks ago
Marked SolutionPending Review

It’s a mix, both Windows and macOS. We manage devices across both platforms.

Marked SolutionPending Review
Participant
2 weeks ago
Marked SolutionPending Review

I used a script from Hexnode’s documentation that could automate certificate expiry checks on Windows devices.
Here’s the link if you want to check it out: https://www.hexnode.com/mobile-device-management/help/script-to-check-certificate-expiry-on-windows-devices/

As for Mac, I didn’t find a script like the one for Windows, but you can use Keychain Access to check certificate expiry manually. https://support.apple.com/en-hk/guide/keychain-access/kyca2794/mac It might not be automatic, but you can at least quickly see expiry dates from there.

Marked SolutionPending Review
Participant
2 weeks ago
Marked SolutionPending Review

Thanks, I’ll check it out.

Marked SolutionPending Review
Participant
1 week ago
Marked SolutionPending Review

Actually, if you want to automate on Mac too, try using this command in Terminal:

This lists all certificates in the System keychain along with their expiry dates. Replace “System.keychain” in /Library/Keychains/System.keychain with other keychains like login.keychain-db or SystemRootCertificates.keychain if you want.

Marked SolutionPending Review
Participant
7 days ago
Marked SolutionPending Review

Hey all, just wanted to share an update. I ran both scripts, and they worked great! Huge relief and saved me tons of time. Thanks for the help!

Save