Last active
August 26, 2016 12:17
-
-
Save robertchong/3c36357dd8366cae60d5 to your computer and use it in GitHub Desktop.
Locate Expired CA Certificates on Your Windows Machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# LocateExpiredCACerts | |
# Source: http://blogs.technet.com/b/heyscriptingguy/archive/2012/05/17/3386232.aspx | |
# | |
$store=new-object System.Security.Cryptography.X509Certificates.X509Store("\\<COMPUTER_NAME>\CA","LocalMachine") | |
$store.open("ReadOnly") | |
$store.certificates | % { | |
If ($_.NotAfter -lt (Get-Date)) { | |
$_ | Select Issuer, Subject, @{Label="ExpiredOn";Expression={$_.NotAfter}} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment