Deploying Certificates to Key Trust Users to Enable RDP

Applies To

  • Windows 10, version 1703 or later
  • Hybrid deployment
  • Key trust

Windows Hello for Business supports using a certificate as the supplied credential when establishing a remote desktop connection to a server or other device. For certificate trust deployments, creation of this certificate occurs at container creation time.

This document discusses an approach for key trust deployments where authentication certificates can be deployed to an existing key trust user.

Three approaches are documented here:

  1. Deploying a certificate to hybrid joined devices using an on-premises Active Directory certificate enrollment policy.

  2. Deploying a certificate to hybrid or Azure AD joined devices using Simple Certificate Enrollment Protocol (SCEP) and Intune.

  3. Working with non-Microsoft enterprise certificate authorities.

Deploying a certificate to a hybrid joined device using an on-premises Active Directory Certificate enrollment policy

Create a Windows Hello for Business certificate template

  1. Sign in to your issuing certificate authority (CA).

  2. Open the Certificate Authority Console (%windir%\system32\certsrv.msc).

  3. In the left pane of the MMC, expand Certification Authority (Local), and then expand your CA within the Certification Authority list.

  4. Right-click Certificate Templates and then click Manage to open the Certificate Templates console.

  5. Right-click the Smartcard Logon template and click Duplicate Template

    Duplicating Smartcard Template.

  6. On the Compatibility tab:

    1. Clear the Show resulting changes check box
    2. Select Windows Server 2012 or Windows Server 2012 R2 from the Certification Authority list
    3. Select Windows Server 2012 or Windows Server 2012 R2 from the Certification Recipient list
  7. On the General tab:

    1. Specify a Template display name, such as WHfB Certificate Authentication
    2. Set the validity period to the desired value
    3. Take note of the Template name for later, which should be the same as the Template display name minus spaces (WHfBCertificateAuthentication in this example).
  8. On the Extensions tab, verify the Application Policies extension includes Smart Card Logon.

  9. On the Subject Name tab:

    1. Select the Build from this Active Directory information button if it is not already selected
    2. Select Fully distinguished name from the Subject name format list if Fully distinguished name is not already selected
    3. Select the User Principal Name (UPN) check box under Include this information in alternative subject name
  10. On the Request Handling tab:

    1. Select the Renew with same key check box
    2. Set the Purpose to Signature and smartcard logon
      1. Click Yes when prompted to change the certificate purpose
    3. Click Prompt the user during enrollment
  11. On the Cryptography tab:

    1. Set the Provider Category to Key Storage Provider
    2. Set the Algorithm name to RSA
    3. Set the minimum key size to 2048
    4. Select Requests must use one of the following providers
    5. Tick Microsoft Software Key Storage Provider
    6. Set the Request hash to SHA256
  12. On the Security tab, add the security group that you want to give Enroll access to. For example, if you want to give access to all users, select the Authenticated users group, and then select Enroll permissions for them .

  13. Click OK to finalize your changes and create the new template. Your new template should now appear in the list of Certificate Templates.

  14. Close the Certificate Templates console.

  15. Open an elevated command prompt and change to a temporary working directory.

  16. Execute the following command:

    certutil -dstemplate <TemplateName> > <TemplateName>.txt

    Replace <TemplateName> with the Template name you took note of earlier in step 7.

  17. Open the text file created by the command above.

    1. Delete the last line of the output from the file that reads CertUtil: -dsTemplate command completed successfully.
    2. Modify the line that reads pKIDefaultCSPs = "1,Microsoft Software Key Storage Provider" to pKIDefaultCSPs = "1,Microsoft Passport Key Storage Provider"
  18. Save the text file.

  19. Update the certificate template by executing the following command:

    certutil -dsaddtemplate <TemplateName>.txt

  20. In the Certificate Authority console, right-click Certificate Templates, select New, and select Certificate Template to Issue

    Selecting Certificate Template to Issue.

  21. From the list of templates, select the template you previously created (WHFB Certificate Authentication) and click OK. It can take some time for the template to replicate to all servers and become available in this list.

  22. After the template replicates, in the MMC, right-click in the Certification Authority list, click All Tasks and then click Stop Service. Right-click the name of the CA again, click All Tasks, and then click Start Service.

Requesting a Certificate

  1. Ensure the hybrid Azure AD joined device has network line of sight to Active Directory domain controllers and the issuing certificate authority.

  2. Start the Certificates – Current User console (%windir%\system32\certmgr.msc).

  3. In the left pane of the MMC, right-click Personal, click All Tasks, and then click Request New Certificate…

    Request a new certificate.

  4. On the Certificate Enrollment screen, click Next.

  5. Under Select Certificate Enrollment Policy, ensure Active Directory Enrollment Policy is selected and then click Next.

  6. Under Request Certificates, click the check-box next to the certificate template you created in the previous section (WHfB Certificate Authentication) and then click Enroll.

  7. After a successful certificate request, click Finish on the Certificate Installation Results screen

Deploying a certificate to Hybrid or Azure AD Joined Devices using Simple Certificate Enrollment Protocol (SCEP) via Intune

Deploying a certificate to Azure AD Joined Devices may be achieved with the Simple Certificate Enrollment Protocol (SCEP) via Intune. For guidance deploying the required infrastructure, refer to Configure infrastructure to support SCEP certificate profiles with Microsoft Intune.

Next you should deploy the root CA certificate (and any other intermediate certificate authority certificates) to Azure AD Joined Devices using a Trusted root certificate profile with Intune. For guidance, refer to Create trusted certificate profiles in Microsoft Intune.

Once these requirements have been met, a new device configuration profile may be configured from Intune that provisions a certificate for the user of the device. Proceed as follows:

  1. Sign in to the Microsoft Endpoint Manager admin center.

  2. Navigate to Devices > Configuration Profiles > Create profile.

  3. Enter the following properties:

    1. For Platform, select Windows 10 and later.
    2. For Profile, select SCEP Certificate.
    3. Click Create.
  4. In Basics, enter the following parameters:

    1. Name: Enter a descriptive name for the profile. Name your profiles so you can easily identify them later. For example, a good profile name is SCEP profile for entire company.
    2. Description: Enter a description for the profile. This setting is optional, but recommended.
    3. Select Next.
  5. In the Configuration settings, complete the following:

    1. For Certificate Type, choose User.

    2. For Subject name format, set it to CN={{UserPrincipalName}}.

    3. Under Subject alternative name, select User principal name (UPN) from the drop-down menu and set the value to CN={{UserPrincipalName}}.

    4. For Certificate validity period, set a value of your choosing.

    5. For Key storage provider (KSP), choose Enroll to Windows Hello for Business, otherwise fail (Windows 10 and later).

    6. For Key usage, choose Digital Signature.

    7. For Key size (bits), choose 2048.

    8. For Hash algorithm, choose SHA-2.

    9. Under Root Certificate, click +Root Certificate and select the trusted certificate profile you created earlier for the Root CA Certificate.

    10. Under Extended key usage, add the following:

      Name Object Identifier Predefined Values
      Smart Card Logon 1.3.6.1.4.1.311.20.2.2 Smart Card Logon
      Client Authentication 1.3.6.1.5.5.7.3.2 Client Authentication
    11. For Renewal threshold (%), set a value of your choosing.

    12. For SCEP Server URLs, provide the public endpoint that you configured during the deployment of your SCEP infrastructure.

    13. Click Next

  6. In Assignments, target the devices or users who should receive a certificate and click Next

  7. In Applicability Rules, provide additional issuance restrictions if required and click Next

  8. In Review + create, click Create

Once the configuration profile has been created, targeted clients will receive the profile from Intune on their next refresh cycle. You should find a new certificate in the user store. To validate the certificate is present, do the following steps:

  1. Open the Certificates - Current User console (%windir%\system32\certmgr.msc)

  2. In the left pane of the MMC, expand Personal and select Certificates

  3. In the right-hand pane of the MMC, check for the new certificate

Note

This infrastructure may also deploy the same certificates to co-managed or modern-managed Hybrid AAD-Joined devices using Intune Policies.

Using non-Microsoft Enterprise Certificate Authorities

If you are using a Public Key Infrastructure that uses non-Microsoft services, the certificate templates published to the on-premises Active Directory may not be available. For guidance with integration of Intune/SCEP with non-Microsoft PKI deployments, refer to Use third-party certification authorities (CA) with SCEP in Microsoft Intune.

As an alternative to using SCEP or if none of the previously covered solutions will work in your environment, you can manually generate Certificate Signing Requests (CSR) for submission to your PKI. To assist with this approach, you can use the Generate-CertificateRequest PowerShell commandlet.

The Generate-CertificateRequest commandlet will generate an .inf file for a pre-existing Windows Hello for Business key. The .inf can be used to generate a certificate request manually using certreq.exe. The commandlet will also generate a .req file, which can be submitted to your PKI for a certificate.

RDP Sign-in with Windows Hello for Business Certificate Authentication

After adding the certificate using an approach from any of the previous sections, you should be able to RDP to any Windows device or server in the same Forest as the user’s on-premises Active Directory account, provided the PKI certificate chain for the issuing certificate authority is deployed to that target server.

  1. Open the Remote Desktop Client (%windir%\system32\mstsc.exe) on the Hybrid AAD-Joined client where the authentication certificate has been deployed.
  2. Attempt an RDP session to a target server.
  3. Use the certificate credential protected by your Windows Hello for Business gesture.