Loading...

Knowledge Base

How to Use PowerShell to Generate CSR for Exchange 2010

Generating a Certificate Signing Request (CSR) is a key step in securing your server with an SSL certificate. This guide provides two methods to generate a CSR for Exchange 2010 using PowerShell, allowing you to choose between displaying the CSR directly on the screen or saving it to a file.

Note: This article is intended for customers with SSL services for Microsoft Exchange Server 2010.

In this article, we'll cover:

Note: You can copy the commands below into a text editor like Notepad to customize the details (such as your domain name) before running them in the Exchange Management Shell.

Method 1: Displaying the CSR on Screen

  1. Open the Exchange Management Shell.
  2. Run one of the following commands to generate your CSR.

    Basic Command:

    New-ExchangeCertificate -GenerateRequest -SubjectName 'C=GB, O=Sectigo Limited, cn=owa.sectigo.com' -KeySize 2048 -PrivateKeyExportable $true

    Command with Multiple Domain Names (SANs):
    Use this command to include Subject Alternative Names (SANs) like `autodiscover`.

    New-ExchangeCertificate -GenerateRequest -SubjectName 'C=GB, O=Sectigo Limited, cn=owa.sectigo.com' -DomainName owa.sectigo.com, owa, autodiscover.sectigo.com -PrivateKeyExportable $true
  3. The CSR will be displayed directly in the shell window. You can now copy the entire text block, including the `-----BEGIN NEW CERTIFICATE REQUEST-----` and `-----END NEW CERTIFICATE REQUEST-----` lines, to submit to your certificate provider.

Method 2: Saving the CSR to a File

  1. Open the Exchange Management Shell.
  2. Run the following two commands in order.

    Step 1: Generate the CSR and store it in a variable.

    $CSR = New-ExchangeCertificate -GenerateRequest -SubjectName 'C=GB, O=Sectigo Limited, cn=owa.sectigo.com' -PrivateKeyExportable $true

    Step 2: Save the variable's content to a text file.
    This command will create a file named `2010certreq.txt` on your C: drive.

    Set-Content -Path 'C:\2010certreq.txt' -Value $CSR
  3. Your CSR is now saved to the file path you specified. You can open this file with any text editor to copy its contents.

Review

Using the `New-ExchangeCertificate` cmdlet in PowerShell, you can quickly generate a CSR for your Exchange 2010 server. By following the steps in this guide, you can create the CSR you need to get your SSL certificate issued and properly secure your server.

Did you find this article helpful?

 
* Your feedback is too short

Loading...