I am trying to write a script that checks the certificate chain in PowerShell (that all the certificates in the chain have not expired) and finds a certificate that is closest to the expiration. I use the following script to find the issuer certificate:
Get-ChildItem -Recurse -Path Cert: | Where-Object {$ _. Subject -eq $ Certificate.Issuer}
For some reason, for some certificates, I get more than one certificate with different Thumbprints that have the same issuer name, and I expected this to be only one.
Is there any other property of the certificate that uniquely identifies the issuer certificate? Maybe there is some other approach for checking the certificate chain?
source share