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
Powershell 获取AD Certificate 详细信息
原创PS_cmdlet ©著作权
文章标签 Certificate 文章分类 运维
©著作权归作者所有:来自51CTO博客作者PS_cmdlet的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章