While using S/MIME certificates for mail encryption or any other type of certificates in the system environment it’s good practice to check from time to time whether some of them are not expiring and not being renewed for some reason. Sometimes user is just not connected due to holidays or some error occurs. Then, certificate expires and we end up with a user who is totally disappointed with the level of IT service etc. :) Well, some of them understand what happened, but usually it’s the other way around.

So in order to check when certificates expire for all users and list those that expire within next 30 days simply create new PowerShell script and run it:)

Enjoy!