批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程
[批处理文件精品]批处理版照片整理器[批处理文件精品]纯批处理备份&还原驱动在线第三方下载
返回列表 发帖

[转载代码] [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):
  1. $today = Get-Date
  2. Get-ChildItem -Path cert:\ -Recurse |
  3.   Where-Object { $_.NotAfter -ne $null  } |
  4.   Where-Object { $_.NotAfter -lt $today } |
  5.   Select-Object -Property FriendlyName, NotAfter, PSParentPath, Thumbprint |
  6.   Out-GridView
复制代码
http://powershell.com/cs/blogs/tips/archive/2014/03/25/finding-expired-certificates.aspx

返回列表