Today I will look at a Powershell script made to retrieve (and if needed, alert on/work with) certificate expiration data.
This is an easy and short script, but it can save someone a lot of trouble.
All it does is take the amount of days you fill in on the $threshold variable and adds those on the day of today. Anything that has an expiration date between today and the “deadline” day it then puts down the information regarding the certificates.
The line containing the Get-ChildItem will contain any exclusions after the Where-Oject. You can adjust this to be a long line of exclusions or turn it into an array and let it check that.
We can use the output to for example be mailed, returned to monitoring software, generate an event viewer alert or anything else.
Hopefully, this will help someone out by keeping their certificates up to date!
Categories: Windows, Powershell, Script, Certificates, Server
Patrick Berger AKA Powershellder.
[ i ] Parallax section below. Click on the section below to upload image. Don't worry if it looks weird in the Weebly editor. It'll look normal on your published site.
To edit or delete your image, press the "toggle" button below. Then, hover over your image until a popup appears with the "edit" and "delete" options. If you don't want a white content section, leave it blank. It will disappear on your live website.