Hi,
The X509Certificate2 object has no "SubjectAlternativeName" property. You can get it from the extensions of the certificate.
Invoke-Command -ComputerName $Servers -ScriptBlock { Get-ChildItem -Recurse Cert:\LocalMachine\My |
select subject,NotBefore, notafter, Issuer, Thumbprint,HasPrivateKey,
@{name='Subject Alternative Name';expression={($_.Extensions | Where-Object {$_.Oid.FriendlyName -eq "Subject Alternative Name"}).format($true)}}
}
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.