Deploy YubiKey PIV authentication for Windows administrator accounts

Configure YubiKey PIV smart-card sign-in with AD CS and MSTSC. Validate strong mapping and recovery before requiring smart cards.

01

Pilot: connect ADM-user01 to SERVER01 without a saved password

CONTOSO.LOCAL, CA01, CONTOSO-CA and SERVER01 are fictional. The Windows session can run as CONTOSO\user01 while the certificate represents CONTOSO\ADM-user01. On an approved admin workstation, the Windows credential provider requests the PIV PIN to use the private key generated on the YubiKey. It is separate from the AD password, Windows Hello PIN and FIDO2 PIN.

02

Logical architecture

The KDC maps the certificate to the privileged identity, and the server enforces RDP logon rights for that account. This diagram shows dependencies rather than the precise wire exchange. The RDP server certificate, KDC certificate and user certificate serve different purposes.

Logical flow
CONTOSO\user01 on an approved Windows admin workstation
  → MSTSC → Windows smart-card credential provider
  → YubiKey PIV: certificate + on-device private key; PIN authorizes use
  → RDP / NLA (CredSSP) and Kerberos certificate sign-in (PKINIT)
  → AD domain controller (KDC): trust, revocation and strong mapping
  → SERVER01.contoso.local: CONTOSO\ADM-user01
03

1. Prepare AD CS and the workstation

Use AD DS, an AD CS enterprise CA, supported and patched Windows versions, a domain-joined Windows workstation, a supported USB PIV key, Smart Card Resource Manager (SCardSvr), the signed Yubico minidriver and the Smart Card KSP. Check supported versions and architectures with the vendor and Windows/RDS access rights for the server role. Start with a member server and an account that is not a Domain Admin. Delegate template and CA publication permissions separately.

Verify DNS, time, DC and CA reachability, AIA/CDP access, trusted root/intermediate certificates, the issuing CA in NTAuth and a suitable valid KDC certificate, preferably using a properly configured Kerberos Authentication template. Confirm relevant chain and revocation checks from the pilot clients and DCs. Do not disable revocation checking to make a test pass.

04

2. Initialize the card

Check model and firmware with ykman. A new key may have the factory PIV PIN 123456; change it before use. The PUK unlocks a blocked PIN, and the management key authorizes provisioning. Change factory values, protect recovery material under the team's policy and use interactive prompts to keep secrets out of shell history.

Caution: a PIV reset erases PIV keys and certificates. Do not use ykman piv reset as a troubleshooting step. Use the recovery key and address revocation before any authorized reset.

Read first, then explicit changes
ykman piv info
ykman piv access change-pin
ykman piv access change-puk
ykman piv access change-management-key
05

3. Create and publish the template

In certtmpl.msc, duplicate Smartcard Logon and record the display and internal names. Add ADM-user01 to the dedicated group without granting broader privileges. Publish in certsrv.msc → Certificate Templates → New → Certificate Template to Issue. Confirm the CA lists the template and an unauthorized account cannot enroll. Do not widen Enroll to clear a denial.

06

Template settings

TabPilot setting
GeneralPrivileged Admin Smart Card Logon; one year, six-week renewal window (examples). Publishing the certificate in AD is optional according to your needs and separate from publishing the template on the CA.
CompatibilitySelect levels supported by the CA and oldest pilot client that allow CNG/KSP.
Request HandlingRetain the logon template purpose. Disable private key export and archival; require user interaction. No autoenrollment for the pilot.
CryptographyKey Storage Provider, RSA 2048 minimum, SHA256 request hash preference, Microsoft Smart Card Key Storage Provider only. Verify the issued certificate signature separately.
Subject NameBuild from this Active Directory information; include UPN in SAN. Do not enable Supply in the request.
ExtensionsSmart Card Logon (1.3.6.1.4.1.311.20.2.2) and Client Authentication (1.3.6.1.5.5.7.3.2). Retain the CA-issued SID security extension.
SecurityRead and Enroll for GG-YubiKey-Privileged-Admins. Remove Enroll and Autoenroll for broad groups; retain CA read access. Restrict template editing rights.
07

4. Enroll under the intended identity

On a secure enrollment workstation, run the command while the pilot account is still permitted to use password sign-in. It opens MMC in the ADM-user01 context; do not use /netonly or /savecred. If strong sign-in is already enforced, use the approved enrollment process instead of disabling it.

In MMC: File → Add/Remove Snap-in → Certificates → My user account. Open Personal → Certificates → All Tasks → Request New Certificate. Select the private template, insert the card and enter the PIV PIN when prompted. Verify identity and hardware destination; stop if offered the software provider or asked to overwrite an existing key. Generate a new nonexportable key on the card.

Command Prompt
runas /user:CONTOSO\ADM-user01 mmc.exe
08

5. Verify the certificate and strong mapping

With the card inserted, certutil -scinfo should enumerate the card, certificate and container. Run certutil -user -store My in the ADM-user01 context; the store of user01 does not prove privileged enrollment. Verify issuer, template, UPN SAN, both EKUs, dates, private-key binding and chain. Look for a successful matching test in -scinfo; exact output varies. Never append CRYPT_DELETEKEYSET to -scinfo.

A correct UPN does not establish strong mapping. Patched DCs no longer support the old KB5014754 compatibility mode after the September 2025 updates. Verify certificate SID extension 1.3.6.1.4.1.311.25.2 against ADM-user01's AD SID. Where a different strong mapping is required, use a Microsoft-supported method under your approval process. Check KDC events 39/40/41 as applicable and investigate chain or CRL errors. Do not weaken DC policy.

09

6. Test the connection with MSTSC

Point MSTSC to SERVER01.contoso.local, keep NLA and server certificate validation, and enable Local Resources → More → Smart cards. Select the smart card sign-in option. Check host redirection policy and Allow log on through Remote Desktop Services; explicit deny takes precedence. If required, identify the cached target with cmdkey /list and remove only that server's entry in Credential Manager.

Sign in with the PIN, then run whoami and klist in the new session. Correlate the remote session with authentication logs on the host and DC; whoami alone does not prove the authentication method. Sign out and repeat fresh connections.

Client Command Prompt
mstsc.exe /v:SERVER01.contoso.local
cmdkey /list
10

7. Minidriver on the RDP destination

Identity Device (NIST SP 800-73 [PIV]) can indicate the generic driver; it does not prove a fault. Compare local output with a redirected card in an authorized remote session. If Yubico specifies Legacy Node for your package and host, install it on SERVER01 first. Substitute your approved signed x64 MSI for the generic filename.

Review the MSI log and verify fresh sign-ins. Handle any required restart in the maintenance window. For regressions, use an independent console to restore the previous driver through the approved process and retest; do not edit DC policy to address a minidriver issue.

Elevated Command Prompt — pilot change
msiexec.exe /i "YubiKey-Minidriver-x64.msi" INSTALL_LEGACY_NODE=1 /quiet /norestart /L*v "%TEMP%\yubikey-minidriver.log"
11

Troubleshooting: from reader to domain controller

Symptom or clueCheck and corrective action
NTE_BAD_KEYSET / Missing stored keysetAbsent container, unprovisioned card or stale association. Compare the certificate and container with certutil -scinfo before reissuing; don't reset the key.
0x80094012 / CERTSRV_E_TEMPLATE_DENIEDCheck whoami, effective group and Read/Enroll on the published template. Refresh the session after a group change.
Microsoft Software Key Storage ProviderKey bound to the local software provider. Correct the template and reissue with a new key on the card; revoke the erroneous issuance under your procedure.
Microsoft Smart Card Key Storage ProviderExpected Windows provider for the template; confirm container and operation on the card. The name alone is not sufficient.
Requested key container does not exist / Identity Device (NIST SP 800-73 [PIV])Compare -scinfo locally and in a redirected session. Check version/driver and Legacy Node guidance; the generic label is a clue.
YubiKey Smart CardExpected driver label; if errors persist, check the container and redirection and compare the two hosts.
UPN / EKU / SIDCompare SAN, both EKUs and SID with the privileged account. Correct the source and reissue instead of weakening mapping.
CRL / CA non approuvéeCheck AIA/CDP, root and intermediate trust, NTAuth and KDC certificate on relevant systems.
Smart Card absente / redirection bloquéeCheck local reader and service, Local Resources, effective policy and gateway support; keep NLA enabled.
PIN incorrect ou bloquéStop guessing; check status. Use the authorized PUK or recovery key.
12

Production: choose the enforcement scope

At the AD account level, Smart card is required for interactive logon follows the account. Test local and remote sign-ins, jobs and apps expecting a password. Clearing the setting does not guarantee the old password becomes usable again; plan identity recovery in advance.

The computer policy at Computer Configuration → Policies → Windows Settings → Security Settings → Local Policies → Security Options → Interactive logon: Require smart card (wording may include Windows Hello for Business) applies to interactive sign-ins on the host. It does not single out one Domain Admin. Neither control means 'require YubiKey only for RDP as ADM-user01.' User rights govern who can connect, not the sign-in method. Pilot in a dedicated OU and test independent console access before applying anything to DCs.

13

Separate identities and application authentication

Use user01 for daily work, ADM-user01 with scoped rights for member servers, and T0-user01 only for AD, DCs and PKI from a privileged admin workstation. Reserve Domain Admin for operations that require it. Authentication Policies and Silos can constrain where privileged accounts authenticate; check AD/Kerberos prerequisites and audit first. Do not start by enforcing a GPO on every DC.

vCenter has its own client certificate authentication when supported by the release, configuration and browser. Verify trust and integration per application. Working RDP PIV does not enable web certificate login, federation or FIDO2 elsewhere. PIV, FIDO2/WebAuthn, OATH and OTP are separate functions depending on model; reserve the admin key for managed work devices.

14

Recovery and rollback

Store and test a second YubiKey with its own private key and certificate before enforcement. If a key is lost, identify the issuance by serial number, revoke it, publish the CRL under the PKI procedure and confirm it is reachable. Handle existing sessions and tickets separately; revocation does not instantly end them. Renew early and test both keys; do not clone a nonexportable key.

If the PIN is blocked, follow the approved PUK procedure or use the backup key. If both fail, use the tested emergency account and console. Roll back only the pilot account enforcement or relevant GPO, allow replication or policy refresh and prove a fresh sign-in. If issuance must stop, unpublish the CA template and handle issued certificates separately.

15

Deployment checklist before enforcement

  • CA, NTAuth, KDC chain and CRL verified; published template with tightly scoped Read/Enroll.
  • On-card key, KSP, UPN, SID, EKUs and container checked; PIN, PUK and management key handled.
  • Workstation and destination drivers validated; Legacy Node tested if applicable. Repeat fresh MSTSC connections and make sure no privileged password is saved for the pilot server.
  • Backup key, revocation, renewal and emergency access tested; third-party applications verified before enforcement.
16

Read-only diagnostic commands

Run card checks locally or from an approved diagnostic session. Inspect the user store in the right context and use delegated authority for log access. SCardSvr may start on demand. Keep outputs containing identities, serial numbers and internal paths private.

PowerShell — read-only diagnostics
certutil -scinfo
certutil -user -store My
certutil -config 'CA01\CONTOSO-CA' -CATemplates
certutil -config 'CA01\CONTOSO-CA' -ping
certutil -enterprise -viewstore NTAuth
Get-Service SCardSvr,PlugPlay
Get-PnpDevice -PresentOnly -Class SmartCard,SmartCardReader
ykman piv info
17

Official sources