Introduction to Health Attestation Service on Windows Server 2019
Windows Device Health Attestation (DHA) is a security feature that allows organizations to verify the boot-time integrity of Windows devices using measurements stored in the Trusted Platform Module (TPM). The Health Attestation Service on Windows Server 2019 is the on-premises server component that collects, validates, and reports on TPM-based health claims from Windows 10 and Windows Server 2016/2019 endpoints. It integrates with System Center Configuration Manager (SCCM), Microsoft Intune, and third-party MDM solutions to enforce conditional access policies — for example, blocking network access for devices that fail health attestation checks (indicating potential bootkit infection, Secure Boot bypass, or BitLocker disabled). This guide covers deploying the Health Attestation Service, configuring SSL, and integrating it with an MDM solution.
Understanding TPM-Based Health Measurements
The TPM is a hardware security chip present on most modern servers and workstations. During the boot process, the Trusted Platform Module records cryptographic measurements of each component that loads: UEFI firmware, Secure Boot policy, bootloader, kernel, and early-launch drivers. These measurements are stored in Platform Configuration Registers (PCRs) in the TPM and cannot be altered without the TPM detecting the change. The Health Attestation service queries the TPM measurements from the client device and validates them against known-good values, determining whether:
Secure Boot is enabled and no unauthorized bootloaders were executed. BitLocker Drive Encryption is active on the OS volume. Early Launch Anti-Malware (ELAM) protection was active during boot. The Windows boot manager, OS loader, and kernel passed integrity checks. Code Integrity (Device Guard/WDAC) policies are enforced. The device has not been subjected to debug mode boot, which bypasses security checks.
Prerequisites for Health Attestation Service
The Health Attestation Service requires Windows Server 2019 (or 2016). The server must have an active internet connection to validate attestation certificates against Microsoft’s certificate transparency infrastructure, unless you configure it for offline operation (which requires manual certificate chain management). The server must run IIS, and the service requires a publicly trusted SSL certificate (for internet-accessible deployments) or an internal CA certificate (for intranet deployments). Client devices must have TPM 2.0 (TPM 1.2 is supported with limitations) and must be running Windows Server 2016/2019 or Windows 10 version 1703 or later.
Install-WindowsFeature -Name Web-Server -IncludeManagementTools
Install-WindowsFeature -Name DeviceHealthAttestation
Installing and Configuring the Health Attestation Service
After installing the feature, open Server Manager and navigate to the Health Attestation Service configuration. Alternatively, use the DeviceHealthAttestation PowerShell module. Run the initial configuration wizard from Server Manager > Tools > Device Health Attestation Service Configuration, or configure via command line.
Configure the certificate for the service endpoint. The Health Attestation service uses HTTPS exclusively. Install your SSL certificate in the Local Computer certificate store. Bind it to the IIS Health Attestation website:
# Import a PFX certificate for the HAS endpoint
$cert = Import-PfxCertificate -FilePath "C:Certshas.company.com.pfx" -CertStoreLocation "Cert:LocalMachineMy" -Password (ConvertTo-SecureString "CertPassword" -AsPlainText -Force)
# Bind the certificate to the IIS HTTPS site
Import-Module WebAdministration
$binding = Get-WebBinding -Name "DeviceHealthAttestation" -Protocol "https"
$binding.AddSslCertificate($cert.Thumbprint, "My")
Configuring the Health Attestation Service via PowerShell
Use the DeviceHealthAttestation module for complete configuration:
Import-Module DeviceHealthAttestation
# Configure the HAS service endpoint
Set-DHASActiveEncryptionCertificate -Thumbprint $cert.Thumbprint -Force
# Configure the signing certificate (can be the same as encryption cert)
Set-DHASActiveSigningCertificate -Thumbprint $cert.Thumbprint -Force
# Configure the certificate validity threshold (days before expiry to alert)
Set-DHASCertificateThreshold -ErrorThreshold 14 -WarningThreshold 30
# Restart the service to apply configuration
Restart-Service -Name DeviceHealthAttestation
Verify the service is running correctly:
Get-Service -Name DeviceHealthAttestation
Get-DHASActiveEncryptionCertificate
Get-DHASActiveSigningCertificate
Test the endpoint by browsing to https://has.company.com/HealthService from a client machine. A valid response indicates the service is functioning correctly.
Integrating with System Center Configuration Manager
SCCM (now Microsoft Endpoint Configuration Manager) can enforce health attestation as a compliance policy. In the SCCM console, navigate to Administration > Client Settings. Edit the Default Client Settings or create a custom client settings policy. Under Computer Agent, configure the Health Attestation Service URL to point to your on-premises HAS server: https://has.company.com/HealthService.
Create a compliance policy in Assets and Compliance > Compliance Settings > Compliance Policies. In the policy rules, add a Device Health Attestation rule. Configure which health properties to evaluate: Secure Boot (required), BitLocker (required), ELAM (required), Code Integrity (required for high-security environments). Assign the compliance policy to a device collection.
Devices that fail the health attestation policy are marked as non-compliant. Configure compliance rules to restrict access — for example, require compliant device status to access corporate email or VPN resources.
Reviewing Health Attestation Reports
View health attestation status in SCCM under Monitoring > Compliance and Settings Management > Device Health Attestation. The report shows all evaluated devices with their health status, which specific measurements passed or failed, and the last evaluation timestamp. Drill down on non-compliant devices to see exactly which boot-time property failed attestation.
Query the HAS service event log on the server for operational events:
Get-WinEvent -LogName "Microsoft-Windows-DeviceHealthAttestation/Admin" | Select-Object TimeCreated, LevelDisplayName, Message | Sort-Object TimeCreated -Descending | Select-Object -First 20 | Format-List
Health Attestation events include attestation requests received, validation results (pass/fail), certificate operations, and service errors. Event ID 100 indicates a successful attestation. Event IDs in the 200-299 range indicate validation failures. Event IDs in the 300-399 range indicate service configuration issues requiring administrator attention.
High Availability for Health Attestation Service
For production environments where health attestation is enforced for network access control, deploy at least two Health Attestation Service servers behind a load balancer. Both servers should share the same signing and encryption certificates (export the PFX with private key and import to both servers). Configure the load balancer with health checks on the HTTPS endpoint. In the MDM/SCCM client settings, configure the HAS URL to point to the load balancer VIP, ensuring clients can reach the service even if one server is down for maintenance. Test failover by shutting down one HAS server and confirming that attestation requests continue to succeed through the remaining server.