Hi Folks,
I found below script in Microsoft forum, this works fine.
However i need to modify the below script to alert me only for a Selected Template Certificates Ex:
Web server Template certificates only. Also i need get output for Certificate below.
Effective Date | Expiration Date | Issued Country/Region | Issues Organizational Unit | Issues Common Name | Issued City | Issued State | Issued Email Address | Requester Name
Kindly help me with above options.
$threshold = 30 #Number of days to look for expiring certificates
$deadline = (Get-Date).AddDays($threshold) #Set deadline date
Dir Cert:\LocalMachine\My | foreach {
If ($_.NotAfter -le $deadline) { $_ | Select Issuer, Subject, NotAfter, @{Label="Expires In (Days)";Expression={($_.NotAfter - (Get-Date)).Days}} }
}
Regards,
Naveen Raj