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

Generating a certificate request


In order to create a new certificate, you need to generate a certificate request using the either the Exchange Management Console, or through the shell using the New-ExchangeCertificate cmdlet. Once you have a certificate request generated, you can obtain a certificate from an internal Certificate Authority or a third party external Certificate Authority. In this recipe, we'll take a look at the process of generating a certificate request from the Exchange Management Shell.

How to do it...

  1. In this example, we'll generate a request using two Subject Alternative Names (SANs). This will allow us to support multiple URLs with one certificate:

    $cert = New-ExchangeCertificate -GenerateRequest `
    -SubjectName "c=US, o=Contoso, cn=mail.contoso.com" `
    -DomainName autodiscover.contoso.com,mail.contoso.com `
    -PrivateKeyExportable $true
  2. After the request has been generated, we can export it to a file that can be used to submit a request to a certificate authority:

    $cert ...