Hello @Roland S ,
You can try the PS script below.
$ou = "ou=laps1,dc=b,dc=local"
$path ="C:\certs"
get-aduser -SearchBase $ou -Filter * -Properties displayname,usercertificate |ForEach-Object{
$displayname = $_.displayname
$_|select -ExpandProperty usercertificate | ForEach-Object{
$cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]$_
[pscustomobject]@{
DisplayName = $displayname
IssuedTo = $cert.Subject
IssuedBy = $cert.Issuer
IntendedPurpose = $cert.EnhancedKeyUsageList
ExpiredData = $cert.NotAfter
SerialNumber = $cert.SerialNumber
}
}
} | Export-Csv -NoTypeInformation $path\certs.csv
Here is the result:
--please don't forget to Accept as answer if the reply is helpful--
Best Regards,
Daisy Zhou
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.