Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Group Policies / How to Deploy SSL Certificate on a Computers Using GPO?

February 16, 2021 Active DirectoryGroup Policies

How to Deploy SSL Certificate on a Computers Using GPO?

Let’s look on how to centrally deploy an SSL certificate on domain computers and add it to the Trusted Root Certification Authorities using Group Policy. After the certificate is deployed, all client devices will trust the services that are signed by this certificate. In our case, we will deploy the self-signed SSL Exchange certificate (the Active Directory Certificate Services role in the domain is not installed) to user’s computers in AD.

If you use a self-signed SSL certificate for your Exchange server, the message will appear on the client computers during the first start of Outlook: this certificate is not trusted and it is not safe to use it.

Outlook certificate warning

To remove this warning, you have to add the Exchange certificate to the list of trusted certificates on the user’s computer. This can be done manually (or by integrating the certificate to the corporate OS image), but it is easier and more effectively to automatically install the certificate using GPO. When using such a certificate distribution scheme, all necessary certificates will be automatically installed on all old and new domain computers.

First of all, you have to export the self-signed certificate from your Exchange server. To do it, logon to your server, run mmc.exe and add Certificates (for a local computer) snap-in.

Certificates - mmc snap-in

Go to the section Certificates (Local Computer) -> Trusted Root Certification Authorities -> Certificates.

Find your Exchange certificate in the right pane, right click on it and select All Tasks -> Export.

export exchange certificate

In the Export Wizard, select DER encoded binary X.509 (.CER) format and specify the path to the certificate file.

certificate export wizard

You can also export the SSL certificate directly from the browser. In Internet Explorer, open the HTTPS address of your web server with an untrusted certificate (in the case of Exchange, this is usually an address of the form https://exchange_cas/owa). Click the Certificate Error icon in the address bar, click View Certificate, and go to the Details tab. Click the Copy to File button to open the Certificate Export to CER file wizard.

copy ssl cert to a cer file from internet explorer

You can also get the SSL certificate of the HTTPS site and save it in a CER file from PowerShell using the WebRequest method:

$webRequest = [Net.WebRequest]::Create("https://exchange_cas/owa")
try { $webRequest.GetResponse() } catch {}
$getcert = $webRequest.ServicePoint.Certificate
$bytes = $getcert.Export([Security.Cryptography.X509Certificates.X509ContentType]::Cert)
set-content -value $bytes -encoding byte -path "c:\ps\your_exchange_cert.cer"

So you have exported the Exchange certificate in a CER file. You need to place the certificate file to the shared network folder and all users must have a read access to it (if necessary, the access can be restricted with NTFS permissions or the folder can be hidden using ABE). For example, let the path to the certificate file be as follows: \\lon-fs01\GroupPolicy$\Certificates.

exchange.cer

Let’s go to the creation of a new certificate deployment policy. To do it, start the Group Policy Management console (gpmc.msc). Create a new policy by selecting the OU (in our example, it is the OU containing computers since we don’t want the certificate to be installed on servers and technological systems), and in the context menu select Create a GPO in this domain and Link it here…

Specify the policy name (Install-Exchange-Certificate) and switch to the policy edit mode.

Create a GPO in this domain and Link it here

In the GPO Editor, go to the section Computer Configuration –> Policies –> Windows Settings –> Security Settings –> Public Key Policies –> Trusted Root Certification Authorities.

Right-click in the right part of the GPO editor window and select Import.

gpo import public key

Specify the path to the imported certificate file, which you have placed in the shared folder.

certificate import wizard in gpo

In the corresponding step of the wizard (Place all certificates in the following store), do specify that it has to be placed in the Trusted Root Certification Authorities.

Trusted Root Certification Authorities

The certificate distribution policy created. You can target this policy on the clients more accurately using Security Filtering or WMI GPO filtering.

Let’s test the group policy settings  by running gpupdate /force on the client. Verify that your certificate has appeared in the list of trusted certificates. It can be done either in the Manage Certificate snap-in (Trusted Root Certification Authorities -> Certificates) or in the Internet Explorer settings (Internet Options -> Content -> Certificates -> Trusted Root Certification Authorities).

trusted root certs

Now during Outlook configuration the warning of the untrusted certificate won’t appear.

You can check that in the browser when you open your HTTPS site (in our example, this is Exchange OWA), a warning about an untrusted SSL certificate will no longer appear. Now, when you configure Outlook to connect your Exchange server (manual configuration of the Exchange server in Outlook 2016 is possible only through the registry), the warning of the untrusted certificate won’t appear.

If you want to apply the certificate deployment policy only to computers (or users) in a specific AD security group, select your Install-Exchange-Cert policy in the Group Policy Management console. On the Scope tab in the Security Filtering section, delete the Authenticated Users group and add your security group name (for example, AllowAutoDeployExchCert). If you link this policy to the domain root, your certificate will be automatically installed on computers that are added to the security group.

ssl certificate installation policy with security filter

The same GPO allows you to install SSL certificates on multiple computers at once. For more information about the certificates that are deployed by your policy, check the policy Settings in the GPMC console. As you can see, the Issued To, Issued By, Expiration Date, and Intended Purposes certificate properties are displayed.

certificate properties in gpo

If computers don’t have direct Internet access, in this way you can update trusted root certificates on all devices in the domain. But there is a simpler and more correct way to update root and revoked certificates in the isolated domains.

Thus, you have certain a policy of automatic certificate distribution on all domain computers (on a specific organizational unit or domain security group). The certificate will be automatically installed on all new computers, without requiring any manual actions from technical support team. For security reasons, it is advisable to periodically scan the Windows Certificate Root store for suspicious and revoked certificates.

 

1 comment
2
Facebook Twitter Google + Pinterest
previous post
How to Create a RAM Disk on Windows Server?
next post
Secure Password (Credentials) Encryption in PowerShell Scripts

Related Reading

Add an Additional Domain Controller to an Existing...

September 6, 2023

Fix: Remote Desktop Licensing Mode is not Configured

August 24, 2023

Refresh AD Groups Membership without Reboot/Logoff

July 15, 2023

How to Backup and Copy Local Group Policy...

July 6, 2023

How to Reset the Group Policy Settings on...

June 23, 2023

1 comment

Kuff February 1, 2022 - 1:34 pm

If you remove Authenticated Users from the scope to add a User AD group, you must delegate read to the computer part. This article is incorrect/misleading, it doesn’t talk about the 2016 change to security filtering https://support.microsoft.com/en-us/help/3163622/ms16-072-security-update-for-group-policy-june-14-2016

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Deploy PowerShell Active Directory Module without Installing RSAT
  • Managing User Photos in Active Directory Using ThumbnailPhoto Attribute
  • Changing Desktop Background Wallpaper in Windows through GPO
  • How to Restore Active Directory from a Backup?
  • Active Directory Dynamic User Groups with PowerShell
  • Restricting Group Policy with WMI Filtering
  • Windows: Block Remote Network Access for Local User Accounts
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top