Book Image

Microsoft Exchange 2010 PowerShell Cookbook

Book Image

Microsoft Exchange 2010 PowerShell Cookbook

Overview of this book

Table of Contents (22 chapters)
Microsoft Exchange 2010 PowerShell Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Verifying certificate health


Exchange 2010 relies on certificates to secure several aspects of communication with clients and servers. X.509 certificates are used with Transport Layer Security (TLS) and Secure Sockets Layer (SSL) to secure communication over protocols such as HTTPS, SMTP, POP, and IMAP. In this recipe, you'll learn how to verify the validity of the certificates installed on your Exchange servers using the Exchange Management Shell.

How to do it...

  1. To verify the health of certificates installed on the local server, use the following command:

    Get-ExchangeCertificate | 
      select Status,
             Thumbprint,
             IsSelfSigned,
             @{n="Expires";e={$_.NotAfter}},
             @{n="DaysLeft";e={($_.NotAfter - $_.NotBefore).Days}}

    The output from this command displays several details about each installed certificate, as in the following screenshot:

  2. To validate the certificates on every server in your organization, use the following code:

    foreach($server in Get-ExchangeServer) {...