Scenario: You need to export specific certificate info for all Exchange 2013 Servers. The script below will output to a txt file the server names along with the Thumbprint, NotAfter, Services, and Subject properties.
Script:
$servers = Get-ExchangeServer | Where AdminDisplayVersion -like *15*
$servers | %{
$Name = $_.Name
$Cert = Get-ExchangeCertificate -server $_.name | Where Subject -like *mail.* | FT Thumbprint, NotAfter, Services, Subject -autosize
Write-Host $_.name
$name, $cert | Out-file C:certs.txt -append
}