How to Get date of ssl certificate with power shell

Adrião Ferreira Ramos 0 Reputation points
2024-02-28T13:25:30.42+00:00

I have a list of servers running IIS with a SSL certificate. it is about to expire. Is there a script or a command I can run and get the SSL certificate date of expiration in all servers and send it to a file?

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-02-29T05:37:38.98+00:00

    Hi Adrião Ferreira Ramos,

    The X.509 certificate stores and certificates can be accessed on the Cert drive like below.

    Get-ChildItem -Path Cert:\LocalMachine\My | Select-Object Subject, NotAfter | Export-Csv -Path C:\Temp\certs.csv 
    

    This will export the certificates in the Personal store to a CSV file.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.