Create an Exchange Server certificate request for a certification authority
Article
Creating a certificate request is the first step in installing a new certificate on an Exchange server to configure Transport Layer Security (TLS) encryption for one or more Exchange services. You use a certificate request (also known as a certificate signing request or CSR) to obtain a certificate from a certification authority (CA). The procedures are the same for obtaining certificates from an internal CA (for example, Active Directory Certificate Services), or from a commercial CA. After you create the certificate request, you send the results to the CA, and the CA uses the information to issue the actual certificate, which you install later.
You can create certificate requests in the Exchange admin center (EAC) or in the Exchange Management Shell. The New Exchange certificate wizard in the EAC can assist you in selecting the host names that are required in the certificate.
What do you need to know before you begin?
You need to be assigned permissions before you can perform this procedure or procedures. For more information on the permissions you need, see the "Client Access services security" entry in the Clients and mobile devices permissions article.
Estimated time to complete: 5 minutes to complete the new certificate request. However, more time is required before the request leads to issuance of a certificate. For more information, see Next steps.
Verify the certificate request requirements of the CA. Exchange generates a PKCS #10 request (.req) file that uses Base64 (default) or Distinguished Encoding Rules (DER) encoding, with an RSA public key that's 1024, 2048 (default), or 4096 bits. Encoding and public key options are only available in the Exchange Management Shell. For more information, see New-ExchangeCertificate.
In the EAC, you need to store the certificate request file on a UNC path (\\<Server>\<Share>\ or \\<LocalServerName>\c$\). In the Exchange Management Shell, you can specify a local path.
The Exchange Admin Center (EAC) can be used to manage certificates in Exchange Server 2019 CU15 and later. For Exchange Server 2016 CU23 and Exchange Server 2019 CU12 to CU14, use the Exchange Management Shell (EMS) procedure.
Open the EAC and navigate to Servers > Certificates.
In the Select server drop-down list, select the Exchange server where you want to install the certificate, and then select Add.
The New Exchange certificate wizard opens.
On the This wizard will create a new certificate or a certificate request file page, verify that Create a request for a certificate from a certification authority is selected, and then select Next.
On the Friendly name for this certificate page, enter a descriptive name for the certificate, and then select Next.
On the Request a wildcard certificate page, make one of the following choices:
If you want a wildcard certificate: Select Request a wildcard certificate, and enter the wildcard character (*) and the domain in the Root domain box, for example, *.contoso.com or *.eu.contoso.com. When you're finished, select Next.
If you want a subject alternative name (SAN) certificate: Make no selections on this page, and select Next.
If you want a certificate for a single host: Make no selections on this page, and select Next.
In the Store certificate request on this server page, select Browse and select the Exchange server where you want to store the certificate request (where you want to install the certificate). Then, select OK and Next.
Note
Steps 7 and 8 only apply to a request for a SAN certificate, or a certificate for a single host. If you selected Request a wildcard certificate, skip to Step 9.
The Specify the domains you want to be included in your certificate page appears. This page is basically a worksheet that helps you to determine the internal and external host names that are required in the certificate for the following Exchange services:
Outlook on the web
Offline address book generation (OAB)
Exchange Web Services
Exchange ActiveSync
Autodiscover
POP
IMAP
Outlook Anywhere
Enter a value for each service based on the location (internal or external). Then, the wizard determines the host names that are required in the certificate, and the information is displayed on the next page.
If you want to modify a value for a service, select Edit () and enter the host name value that you want to use (or delete the value). When you're finished, select Next.
Note
If you've already determined the host name values that you need in the certificate, you don't need to fill out the information on this page. Instead, select Next to manually enter the host names on the next page.
The Based on your selections, the following domains will be included in your certificate page appears. This page lists the host names that will be included in the certificate request. The host name that's used in the certificate's Subject box is bold, which can be hard to see if that host name is selected.
Verify the host name entries that are required in the certificate by referring to the selections that you made on the previous page.
If you don't want to consider this list of host names for inclusion in the certificate request, go to Step 10.
Ignore the values from the last page and add, edit, or remove host name values by performing the following steps:
a. If you want a SAN certificate: To select the host name for the certificate's Subject field, select the value and select Set as common name (check mark). The value should now appear bold.
b. If you want a certificate for a single host name: Select the other values one at a time and select Remove ().
Note
You can't delete the bold host name value that will be used for the certificate's Subject box. First, you need to select or add a different host name, and then check the Set as common name box.
The changes that you make on this page might be lost if you select the Back button.
On the Specify information about your organization page, enter the following values:
Organization name
Department name
City/Locality
State/Province
Country/Region name
Note
These X.500 values are included in the certificate's Subject box. Although a value is required in every field before you can proceed, the CA might not care about certain fields (for example, Department name), while other fields are important (for example, Country/Region name and Organization name). Check the Subject box requirements of your CA.
When you're finished, select Next.
On the Save the certificate request to the following file page, enter the UNC path and filename for the certificate request, for example, \\FileServer01\Data\ExchCertRequest.req. When you're finished, select Finish.
The certificate request appears in the list of Exchange certificates with a status value of Pending. For more information on the next steps, see Next steps section.
Use the Exchange Management Shell to create a new certificate request
To create a new request for a wildcard certificate, a SAN certificate, or a certificate for a single host, use the following syntax:
If you need to send the content of the certificate request file to the CA, use the following syntax to create a Base64 encoded request file:
The only required part of the X.500 SubjectName parameter value (the certificate's Subject box) to run the command is CN=<HostNameOrFQDN>. But, you should always include the C=<CountryOrRegion> value. Otherwise, you might not be able to renew the certificate. Check the Subject box requirements of your CA.
If you don't use the KeySize parameter, the certificate request has a 2048-bit RSA public key.
If you don't use the Server parameter, the command is run on the local Exchange server.
These examples create certificate request files for SAN certificates with the following properties:
SubjectName: mail.contoso.com in the United States, which requires the value C=US,CN=mail.contoso.com. This CN value is automatically included in the DomainName parameter (the Subject Alternative Name field).
Other Subject Alternative Name field values:
autodiscover.contoso.com
legacy.contoso.com
mail.contoso.net
autodiscover.contoso.net
legacy.contoso.net
RequestFile: \\FileServer01\Data\Contoso SAN Cert.<cer or pfx>
FriendlyName: Contoso.com SAN Cert
DomainName: Unquoted comma-separated list of domains
To create a Base64 encoded request file for the SAN certificate, run the following command:
$txtrequest = New-ExchangeCertificate -PrivateKeyExportable $True -GenerateRequest -FriendlyName "Contoso.com SAN Cert" -SubjectName "C=US,CN=mail.contoso.com" -DomainName autodiscover.contoso.com,legacy.contoso.com,mail.contoso.net,autodiscover.contoso.net,legacy.contoso.net
[System.IO.File]::WriteAllBytes('\\FileServer01\Data\Contoso SAN Cert.req', [System.Text.Encoding]::Unicode.GetBytes($txtrequest))
To create a DER encoded request file for the SAN certificate, run the following command:
$binrequest = New-ExchangeCertificate -PrivateKeyExportable $True -GenerateRequest -BinaryEncoded -FriendlyName "Contoso.com SAN Cert" -SubjectName "C=US,CN=mail.contoso.com" -DomainName autodiscover.contoso.com,legacy.contoso.com,mail.contoso.net,autodiscover.contoso.net,legacy.contoso.net
[System.IO.File]::WriteAllBytes('\\FileServer01\Data\Contoso SAN Cert.pfx', $binrequest.FileData)
Single subject certificate request
These examples create certificate request files for single subject certificates with the following properties:
SubjectName: mail.contoso.com in the United States, which requires the value C=US,CN=mail.contoso.com.
RequestFile: \\FileServer01\Data\Mail.contoso.com Cert.<cer or pfx>
FriendlyName: Mail.contoso.com Cert
To create a Base64 encoded request file for the single subject certificate, run the following command:
To verify that you've successfully created a new certificate request, perform either of the following steps:
In the EAC at Servers > Certificates, verify whether the server where you stored the certificate request is selected. The request should be in the list of certificates with the Status parameter's value set as Pending request.
In the Exchange Management Shell on the server where you stored the certificate request, run the following command:
You need to send this information to the CA. How you send it depends on the CA, but typically, you send the contents of the file in an email message or in the certificate request form on the CA's website.
If the CA requires a binary certificate request that's encoded by DER (you used the New-ExchangeCertificate cmdlet with the BinaryEncoded switch), you typically send the whole certificate request file to the CA.
As a Windows Server hybrid administrator, you integrate Windows Server environments with Azure services and manage Windows Server in on-premises networks.