Exchange Certificate Cleanup via PowerShell

A short post today, just to find all MS Exchange certificates which have expired, filtered by domain name, and remove them from your exchange server. This should work with Microsoft Exchange 2007 and 2010.

$Domain = read-host "Enter Domain Name to Search for (e.g. webmail.domain.tld)"
Get-ExchangeCertificate | where {$_.NotAfter -lt (get-date) -and $_.Subject -like "*$Domain*"} | Remove-ExchangeCertificate -confirm: $false

Share

Recent Posts

Microsoft

McCann & MullenLowe – Microsoft Teams Case Study

When bringing companies with different technology systems together, it can be difficult to efficiently collaborate. #Microsoft Teams can help. Learn how its single platform system provided McCann and MullenLowe with the solution they needed to enable their employees to work together. Check out this video:

Read More »