Using PowerShell to Find Expiring SSL Certificates & the Websites they’re Associated with

Have you recently received a notification about an expiring SSL certificate and don’t remember where all it’s used at? It’s generally not an issue to figure this out with normal certificates which are issued for a single name, but if it’s a wildcard certificate, it could be used on lots of different websites within your organization. The following PowerShell script retrieves all of the SSL certificate’s thumbprints and their expiration dates on an individual server that has IIS installed (This has only been tested on Windows Server 2008 R2).

Luckily with a wildcard certificate, the thumbprint will be the same for it across all servers. The code below can be wrapped inside of Invoke-Command to run it remotely against multiple servers to determine all the websites the certificate is used on.

µ

1 Comment

  1. DC

    Great post Mike. I am about to deal with expiring certs soon and wanted to know the expiration dates.

    Reply

Leave a Reply

%d bloggers like this: