Skip to content

Instantly share code, notes, and snippets.

@seyerj
Created December 17, 2021 19:35
Show Gist options
  • Save seyerj/4c56bb4c585030ea6737955c89c91a43 to your computer and use it in GitHub Desktop.
Save seyerj/4c56bb4c585030ea6737955c89c91a43 to your computer and use it in GitHub Desktop.
Powershell pulls all expired certs from local server and dumps into C:\temp\expiredcerts.htm
Get-ChildItem cert:\ -Recurse | Where-Object {$_ -is [System.Security.Cryptography.X509Certificates.X509Certificate2] -and $_.NotAfter -lt (Get-Date)} | Select-Object -Property FriendlyName,NotAfter | ConvertTo-Html | Set-Content C:\Temp\ExpiredCerts.htm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment