Powershell 7 script to check a list of urls for Certificate Expiration Dates
Example of how to call it:
.\CheckForExpiredSSLCertificates.ps1 -Path "C:\Temp\check-urls.csv" -To "[email protected]" -From "[email protected]" -WarningCertAgeDays 20 -CriticalCertAgeDays 10 -Subject "SSL Expiration Notice" -SMTPServer "smtp.example.com"
URL | Check result | Expires in days | Expires on | Server | Business Application | Owner | Issuer | Wildcard | Details |
---|---|---|---|---|---|---|---|---|---|
https://internalapp.example.com | CRITICAL | -37 | 3/1/2022 | App Server 01 | Internal App 1 | Web Team | Internal CA | Expiration date is hard coded into the spreadsheet make sure to update the spreadsheet when the certificate is updated. | |
https://brokenurl.example.com | ERROR | Exception while checking URL https://brokenurl.example.com: Exception calling ".ctor" with "2" argument(s): "No such host is known." | |||||||
https://anotherinternalapp.example.com | WARNING | 42 | 5/20/2022 | App Server 01 | Another Internal App | Web Team | Internal CA | Expiration date is hard coded into the spreadsheet make sure to update the spreadsheet when the certificate is updated. | |
https://en.wikipedia.org/ | OKAY | 63 | 6/10/2022 2:44:58 AM | Wikipedia web server | Wikipedia | Web Team | R3 | Yes | |
https://vpn.example.com | OKAY | 327 | 3/1/2023 | Firewall | VPN | Security Team | DigiCert | Expiration date is hard coded into the spreadsheet make sure to update the spreadsheet when the certificate is updated. | |
https://example.com | OKAY | 341 | 3/14/2023 6:59:59 PM | Web Server 01 | Web Site | Web Team | DigiCert |
Edit this file to update the list that is checked:
"C:\Temp\check-urls.csv"