标题: [转载代码] [PowerShell每日技巧]查找过期证书(20140325) [打印本页]
作者: DAIC 时间: 2014-4-3 10:51 标题: [PowerShell每日技巧]查找过期证书(20140325)
PowerShell grants access to your certificate stores by using the cert: drive.
You can use this drive to find certificates based on given criteria. This would list all certificates that have a date in NotAfter that is before today (indicating expired certificates):- $today = Get-Date
-
- Get-ChildItem -Path cert:\ -Recurse |
- Where-Object { $_.NotAfter -ne $null } |
- Where-Object { $_.NotAfter -lt $today } |
- Select-Object -Property FriendlyName, NotAfter, PSParentPath, Thumbprint |
- Out-GridView
复制代码
http://powershell.com/cs/blogs/tips/archive/2014/03/25/finding-expired-certificates.aspx
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |