PKI & Certificate Management
Enterprise certificate delivery via SCEP and PKCS โ from Certificate Connector setup to Wi-Fi, VPN, and email authentication across all managed platforms.
๐ Overview & Licensing
๐ฏ Core Capabilities
- Automated certificate provisioning to all platforms
- Device and user certificate delivery
- Wi-Fi, VPN, and email client authentication
- S/MIME encryption and signing
- Automatic renewal before expiry
- Certificate revocation on device wipe/retire
๐ Licensing Requirements
| Feature | License |
|---|---|
| SCEP Profiles | Intune P1 |
| PKCS Profiles | Intune P1 |
| S/MIME (user cert) | P1 + Exchange |
| Third-party CA | P1 + CA API |
SCEP vs. PKCS โ Comparison
| Attribute | SCEP | PKCS #12 (PFX) |
|---|---|---|
| Private key location | Generated on device (never leaves) | Generated on server, delivered encrypted |
| Security posture | Higher (non-exportable key) | Lower (PFX can be extracted) |
| CA requirement | ADCS with NDES role | ADCS (direct PFX) |
| Supported platforms | Windows, iOS, Android, macOS | Windows, iOS, Android, macOS |
| Use for Wi-Fi/VPN | โ Preferred | โ Supported |
| Use for S/MIME | Limited | โ Preferred (exportable) |
๐๏ธ PKI Architecture
๐ End-to-End Certificate Flow
๐ข ADCS (NDES) Architecture
- Root CA: Offline, air-gapped for maximum security
- Issuing CA: Online, member of domain
- NDES server: Separate from CA (IIS + SCEP module)
- Certificate Connector: Installed on NDES server
- Service Account: Domain account with specific permissions
โ๏ธ Third-Party CA Support
- DigiCert, Entrust, GlobalSign via API
- Connector communicates with CA REST API
- No NDES required for cloud CAs
- Custom subject name support
- PKCS flows only (not SCEP for third-party)
๐ Certificate Authority Hierarchy
| Tier | Role | Recommendation |
|---|---|---|
| Root CA | Trust anchor, signs Issuing CA | Offline, HSM, 4096-bit RSA or P-384 ECDSA |
| Issuing CA | Issues end-entity certificates | Online, 2-year cert lifetime, CDP/AIA published |
| NDES | SCEP endpoint for devices | Dedicated server, load balanced for scale |
| Connector | Intune โ CA bridge | Installed on NDES, outbound HTTPS only |
๐ Certificate Connector
Download Connector
Go to Intune admin center โ Tenant administration โ Connectors and tokens โ Certificate connectors โ Download the connector installer.
Install on NDES Server
Run the installer as local administrator. Select SCEP and/or PKCS as needed. The connector runs as a Windows service.
Authenticate to Intune
Sign in with a Global Admin or Intune Admin account when prompted. This creates a trust relationship between the connector and your Intune tenant.
Verify Status
In the Intune portal, the connector should show Active within 5 minutes. Check Windows Event Log: Applications and Services Logs โ Microsoft โ Intune โ Certificate Connector.
โ๏ธ Service Account Permissions
- Domain user account (not local account)
- Enroll permission on the certificate template
- Read and Enroll on the NDES template
- Log on as a service right on the NDES server
- Member of IIS_IUSRS local group on NDES
๐ Network Requirements
| Direction | Endpoint | Port |
|---|---|---|
| Outbound | *.manage.microsoft.com | 443/HTTPS |
| Outbound | *.microsoftonline.com | 443/HTTPS |
| Outbound | *.azure.com | 443/HTTPS |
| Internal | NDES โ Issuing CA | 135/RPC, 49152+ |
โป๏ธ High Availability Setup
- Install multiple connectors on different NDES servers
- Intune load balances automatically across active connectors
- Each connector must be registered separately in Intune
- Use NLB or Azure Load Balancer for NDES SCEP URL
- Minimum 2 connectors recommended for production
โ๏ธ SCEP Certificate Profiles
๐ Certificate Template Settings
- Template name: Must match ADCS template exactly
- Certificate type: Device or User
- Subject name format: CN={{DeviceName}} or CN={{AAD_Device_ID}}
- SAN: DNS={{DeviceName}}, UPN={{UserPrincipalName}}
- Certificate validity: 1โ2 years typical
- Key storage provider: TPM preferred
๐ Key Usage Options
- Digital Signature: Client authentication
- Key Encipherment: Data encryption
- Extended Key Usage: Client Auth OID (1.3.6.1.5.5.7.3.2)
- Key size: 2048 or 4096 bits
- Hash algorithm: SHA-256 minimum
๐ท๏ธ Dynamic Subject Name Variables
| Variable | Value | Use Case |
|---|---|---|
| {{DeviceName}} | Device hostname | Device certs, Wi-Fi, VPN |
| {{AAD_Device_ID}} | Azure AD Device Object ID | Conditional Access device identity |
| {{UserPrincipalName}} | user@domain.com | User certs, email auth |
| {{serialNumber}} | Device serial number | Hardware-bound identity |
| {{IMEI}} | Mobile IMEI | Mobile device identity |
| {{OnPrem_Distinguished_Name}} | AD DN | Hybrid join scenarios |
# SCEP Profile via Graph API
POST https://graph.microsoft.com/beta/deviceManagement/deviceConfigurations
{
"@odata.type": "#microsoft.graph.windows10CertificateProfileBase",
"displayName": "SCEP - Wi-Fi Client Auth - Windows",
"certificationAuthority": "ca.corp.contoso.com",
"certificationAuthorityName": "Contoso Issuing CA",
"certificateTemplateName": "IntuneWiFiClient",
"subjectNameFormat": "CN={{DeviceName}}",
"subjectAlternativeNameType": "dnsName",
"keyUsage": "digitalSignature",
"extendedKeyUsages": [{ "objectIdentifier": "1.3.6.1.5.5.7.3.2", "name": "Client Authentication" }],
"scepServerUrls": ["https://ndes.corp.contoso.com/certsrv/mscep/mscep.dll"],
"validityPeriodValue": 1,
"validityPeriodScale": "years",
"renewalThresholdPercentage": 20
}
๐ PKCS Certificate Profiles
๐ฆ PKCS Profile Settings
- Certificate Authority: FQDN of Issuing CA
- CA Name: Common Name of the CA
- Template: Certificate template name in ADCS
- Subject name format: Same variables as SCEP
- Renewal threshold: 20โ30% before expiry
- Key storage: Software KSP or TPM
๐ PKCS Imported Certificates
- Pre-existing PFX files imported to Intune
- Used for S/MIME (same cert across devices)
- Upload via PowerShell or Graph API
- Delivered encrypted per-device
- Requires separate PKCS Imported profile type
# PowerShell: Upload PKCS Imported PFX for S/MIME
Import-Module Microsoft.Graph.DeviceManagement
# Read PFX file and encode
$pfxData = [System.IO.File]::ReadAllBytes("C:\certs\user_smime.pfx")
$pfxBase64 = [Convert]::ToBase64String($pfxData)
# Create the imported certificate
$body = @{
userPrincipalName = "alice@contoso.com"
password = "PfxPassword123!"
pkcs12Value = $pfxBase64
intendedPurpose = "smimeEncryption"
}
New-MgDeviceManagementUserPfxCertificate -BodyParameter $body
โ Trusted Root Certificate Profiles
๐ณ Root CA Deployment
Export Root CA Certificate
Export Root CA cert as .cer (DER encoded) from Certification Authority MMC.
Create Trusted Certificate Profile
Intune โ Device Configuration โ Create Profile โ Trusted certificate โ Upload .cer file.
Assign to All Devices Group
Assign broadly to All Devices or all targeted device groups before SCEP/PKCS profiles.
๐ข Intermediate CA Deployment
- Also deploy Intermediate/Issuing CA certificate
- Separate Trusted Certificate profile per CA
- Destination store: Computer (for device certs), User (for user certs)
- Include full chain if third-party CA is used
๐ก Wi-Fi & VPN Authentication
๐ก 802.1X Wi-Fi Profile
- EAP Type: EAP-TLS (certificate-based)
- Authentication method: Certificate
- Client certificate: Reference SCEP profile
- Server validation: Root CA certificate
- Identity Privacy: anonymous@domain.com
๐ Profile Dependency Chain
๐ก๏ธ VPN Certificate Auth
- Supported: Always On VPN, Cisco AnyConnect, Pulse Secure
- Certificate EKU must include Server Authentication on VPN gateway
- Client cert delivered via SCEP or PKCS
- Use device certificate for machine tunnels
- Use user certificate for user tunnels
๐ Always On VPN Config
- Device Tunnel: System certificate (device cert)
- User Tunnel: User certificate (user cert)
- Both tunnels can use certificate auth simultaneously
- Requires Windows 10 1709+ or Windows 11
โ๏ธ Email & S/MIME
๐ S/MIME Configuration
- Signing cert: PKCS Imported or SCEP user cert
- Encryption cert: PKCS Imported (must be exportable)
- Both Outlook for iOS/Android and native mail apps
- Enroll via iOS/Android email profile referencing cert
- Public key sharing: Automatic via Exchange GAL
๐ง Outlook S/MIME Steps
Deploy signing certificate
SCEP or PKCS user certificate with Email Protection EKU.
Deploy encryption certificate
PKCS Imported PFX with same email address as UPN.
Configure email profile
Reference both certificates in the iOS/Android email configuration profile.
๐ Lifecycle & Renewal
โณ Renewal Logic
- Renewal threshold: percentage of cert lifetime
- Default: 20% (e.g., renew 73 days before expiry for 1-year cert)
- Intune automatically triggers renewal
- New certificate issued without user interaction
- Old certificate revoked on successful renewal
๐๏ธ Revocation Scenarios
- Device retire: Certificate automatically revoked
- Device wipe: Certificate revoked and removed
- Profile unassignment: Certificate revoked from device
- User removed: User cert revoked
- Manual revocation: Via ADCS MMC or script
๐ Monitoring & Reports
๐ Certificate Inventory
- Intune โ Devices โ Monitor โ Certificate
- Status: Installed, Error, Pending
- Expiry date per device
- Export to CSV
๐ Connector Health
- Intune โ Tenant admin โ Connectors
- Last check-in time
- Active / Warning / Error status
- Connector version
๐ก Event Log (On-prem)
- Applications and Services Logs
- Microsoft โ Intune โ CertConnector
- NDES IIS logs: %SystemDrive%\inetpub\logs
- CA Event Log: Security (Event 4886)
๐ง Troubleshooting
โ Common Issues & Solutions
| Symptom | Likely Cause | Resolution |
|---|---|---|
| Certificate profile in Error state | NDES unreachable or wrong SCEP URL | Test SCEP URL from device browser; check firewall |
| Connector shows inactive | Outbound HTTPS blocked, service stopped | Check network, restart Intune Connector Service |
| Certificate issued but not installed | Template permissions missing | Grant service account Enroll on template |
| PKCS cert not delivered | CA FQDN or name mismatch | Verify CA Name matches exactly in profile |
| Renewal not triggering | Threshold too low, device offline | Increase threshold; ensure device checks in regularly |
| EAP-TLS Wi-Fi fails | Root CA not trusted, wrong EKU | Verify root/intermediate deployed; check Server Auth EKU |
# Test SCEP URL from client (PowerShell)
$scepUrl = "https://ndes.corp.contoso.com/certsrv/mscep/mscep.dll"
$response = Invoke-WebRequest -Uri $scepUrl -Method GET -UseDefaultCredentials
Write-Host "Status: $($response.StatusCode)"
# Check Intune certificate connector logs
Get-EventLog -LogName "Microsoft-Intune-CertConnector/Operational" -Newest 50 |
Where-Object { $_.EntryType -eq "Error" } |
Select-Object TimeGenerated, Message
# List certificates on device
Get-ChildItem Cert:\LocalMachine\My | Select-Object Subject, NotAfter, Issuer
๐ป PowerShell & Graph API
# Get all SCEP/PKCS profiles via Graph
Connect-MgGraph -Scopes "DeviceManagementConfiguration.Read.All"
$profiles = Get-MgDeviceManagementDeviceConfiguration |
Where-Object { $_.'@odata.type' -like "*Certificate*" }
$profiles | Select-Object DisplayName, Id, LastModifiedDateTime
# Get certificate deployment status per device
$profileId = "your-profile-guid"
Get-MgDeviceManagementDeviceConfigurationDeviceStatus -DeviceConfigurationId $profileId |
Select-Object DeviceDisplayName, Status, LastReportedDateTime
# Export certificate report to CSV
$results = Get-MgDeviceManagementDeviceConfigurationDeviceStatus -DeviceConfigurationId $profileId
$results | Export-Csv -Path "C:\Reports\CertStatus.csv" -NoTypeInformation
# Check connector health via Graph
GET https://graph.microsoft.com/beta/deviceManagement/ndesConnectors
# Revoke certificate manually
$caServer = "ca.corp.contoso.com"
$serialNum = "1a2b3c4d5e6f"
certutil -config $caServer -revoke $serialNum 0 # 0 = Unspecified
โ Implementation Checklist
๐๏ธ Infrastructure
- Root CA is offline and secured
- Issuing CA configured with proper templates
- NDES role installed on dedicated server
- Certificate Connector installed and Active
- Service account permissions configured
- Outbound HTTPS 443 open from connector
- SCEP URL accessible from managed devices
๐ Profiles
- Trusted Root CA profile created and assigned
- Intermediate CA profile created (if applicable)
- SCEP profile for device certificates
- SCEP/PKCS profile for user certificates
- Profile assignment order: Root โ SCEP โ Wi-Fi/VPN
- Renewal threshold set (20โ30%)
๐งช Testing
- Pilot device receives certificate successfully
- Wi-Fi EAP-TLS authentication working
- VPN certificate auth verified
- Certificate revocation on retire tested
- Renewal tested with shortened validity
๐ Operations
- Certificate expiry monitoring alert configured
- Connector health monitoring enabled
- Runbook for connector failure documented
- CA CRL publishing schedule verified
- High availability (2+ connectors) in place