Replacing the SSL certificate on AD FS touches several components that do not all update the same way. The Set-AdfsSslCertificate cmdlet propagates the new binding across AD FS farm members automatically on Windows Server 2016 and later, but Web Application Proxy servers do not inherit the change and must be updated individually. Before you touch anything, import the new certificate with its private key to the Local Machine Personal store on every node and grant the AD FS service account Read access to the private key — a missing permission or a thumbprint containing stray spaces or hidden characters will cause the certificate to fail to bind and sign-in to break for all relying parties. This guide walks through backing up the current certificate for rollback, importing and permissioning the new one, updating the primary AD FS server and each WAP node, restarting services, and confirming authentication works before you consider the change complete.
Before you start
What you will learn
- You will learn how to replace the SSL certificate on every AD FS and Web Application Proxy (WAP) server in a Windows Server 2025 farm, from importing the new certificate to binding it and verifying authentication end to end.
- An expired or misconfigured SSL certificate breaks federated sign-in for every application that relies on AD FS. Doing the replacement correctly — with the right private key permissions and a clean thumbprint — avoids a farm-wide authentication outage.
Requirements
- You need local administrator rights on every ADFS and Web Application Proxy (WAP) server in the farm, plus a PowerShell session run as administrator. You also need the new SSL certificate as a .pfx/.p12 file including its private key and the export/import password.
- Windows Server 2025 ADFS farm with one or more WAP servers. Set-AdfsSslCertificate auto-propagates the SSL binding to farm members on Server 2016 and later; WAP servers must still be updated individually.
- Local Administrator on each ADFS and WAP server
- AD FS administrator (able to run AD FS cmdlets and manage the farm)
- Permission to manage the ADFS service account (or gMSA) private key ACLs
Good to know
- Steps reflect AD FS and Web Application Proxy on Windows Server 2025; farm-wide propagation behavior applies to Server 2016 and later.
Quick answer
Import the new certificate (with private key) to the Local Machine Personal store on every AD FS and WAP server, grant the AD FS service account Read on the private key, then run Set-AdfsSslCertificate -Thumbprint on the primary AD FS server. It auto-propagates across AD FS nodes on Server 2016+, but you must update each WAP server separately and restart the AD FS service on all nodes.
Set-AdfsSslCertificate -Thumbprint "YOUR_CERT_THUMBPRINT"Step-by-step tutorial
9 stepsRecord the current certificate and back it up
Capture a rollback point before changing any certificate binding.
mmc.exe > Certificates (Local Computer) > Personal > Certificates > right-click > All Tasks > ExportBefore touching any binding, capture everything you need to restore the current state. A wrong thumbprint or a certificate whose private key the service account cannot read will break sign-in for the entire farm, so treat this step as mandatory.
- On the primary ADFS server, record the current SSL binding and its thumbprint:
Get-AdfsSslCertificate
Note the PortNumber and CertificateHash values from the output.
- Export the current SSL certificate with its private key to a
.pfxso you can re-import it if you need to roll back. Openmmc.exe, add the Certificates snap-in for Computer account > Local computer, then go to Certificates (Local Computer) > Personal > Certificates. Right-click the current certificate and choose All Tasks > Export, selecting Yes, export the private key and a strong password.
- On each Web Application Proxy (WAP) server, record the current binding with
Get-WebApplicationProxySslCertificateso you know exactly which certificate to restore there too.
Get-AdfsSslCertificate
Get-WebApplicationProxySslCertificateThe account exporting the private key must have permission to do so, and the certificate must have been imported as exportable. Store the .pfx and its password somewhere secure and off the server. Keep this backup until you have confirmed the new certificate works end to end.
Import the new SSL certificate to all servers
Place the new certificate with its private key in the Local Machine store on every node.
mmc.exe > Certificates (Local Computer) > Personal > Certificates > right-click > All Tasks > ImportImport the new certificate (with its private key) into the Local Machine Personal store on every ADFS and WAP server in the farm. Using the same .pfx file on all servers avoids subtle mismatches.
- On each server, open
mmc.exeand add the Certificates snap-in: File > Add/Remove Snap-in > Certificates > Add > Computer account > Local computer > Finish > OK. - Navigate to Certificates (Local Computer) > Personal > Certificates. Right-click in the empty pane and choose All Tasks > Import.
- In the Certificate Import Wizard, select your
.pfx/.p12file, enter the private key password, keep the store location as Local Machine, and confirm the certificate store is Personal. - Verify with PowerShell that the certificate is present and carries its private key.
Get-ChildItem -Path Cert:\LocalMachine\My | Where-Object {$_.Subject -like "*your-domain.com*"} | Select-Object Subject, Thumbprint, HasPrivateKey, NotAfterReplace your-domain.com with your ADFS federation service name. If HasPrivateKey is False, the .pfx was imported without its key — re-import from the original file that contains the private key. Repeat the import on every node before moving on.
Grant the ADFS service account private key permissions
Ensure the ADFS service account can read the new certificate's private key.
Certificates (Local Computer) > Personal > Certificates > right-click cert > All Tasks > Manage Private Keys > AddThe ADFS service account must have read access to the new certificate's private key, or the service cannot bind the certificate and authentication will fail.
- In the Certificates MMC (Local Computer > Personal > Certificates), right-click the new certificate and choose All Tasks > Manage Private Keys.
- Click Add to open the object picker.
- If ADFS runs under a Group Managed Service Account (gMSA), click Object Types and enable Service Accounts, then enter the account name (it ends with
$), for exampleDOMAIN\ADFS-Service$. - Grant Read (Full Control is optional and useful during troubleshooting), then click OK.
- Repeat on every ADFS server. Confirm the account name with
(Get-WmiObject Win32_Service -Filter "Name='adfssrv'").StartNameif you are unsure which account the service uses.
(Get-WmiObject Win32_Service -Filter "Name='adfssrv'").StartNameWithout this permission the Set-AdfsSslCertificate step may appear to succeed but the service will fail to serve the certificate after restart. For gMSA accounts you must enable the Service Accounts object type or the picker will not resolve the $-suffixed name. WAP servers do not use the ADFS service account, so this step applies to ADFS nodes only.
Update the Service Communications certificate (optional)
Optionally align the service communications certificate with the new SSL certificate.
Server Manager > Tools > AD FS Management > Service > Certificates > Service Communications > Set Service Communications CertificateThis step is optional but recommended for consistency — many deployments use the same certificate for both the SSL binding and service communications.
UI method: 1. Open Server Manager > Tools > AD FS Management. 2. In the left pane, expand Service > Certificates. 3. Right-click Service Communications and choose Set Service Communications Certificate, then pick the new certificate and click OK.
PowerShell method (equivalent):
Set-AdfsCertificate -CertificateType Service-Communications -Thumbprint "YOUR_CERT_THUMBPRINT"
After setting it, verify the change.
Set-AdfsCertificate -CertificateType Service-Communications -Thumbprint "YOUR_CERT_THUMBPRINT"
Get-AdfsCertificate -CertificateType Service-CommunicationsReplace YOUR_CERT_THUMBPRINT with the thumbprint captured in the next step (or copy it now). Skip this step entirely if your token-signing/service-communications lifecycle is managed separately. The SSL certificate and the Service Communications certificate can be the same certificate.
Get the new certificate thumbprint
Obtain the exact, clean thumbprint needed for the SSL commands.
You need the exact thumbprint of the new certificate for the SSL commands. Copy it cleanly — stray spaces or hidden characters are the most common cause of Set-AdfsSslCertificate failing.
- List certificates in the Personal store with their thumbprints and expiry:
Get-ChildItem -Path Cert:\LocalMachine\My | Select-Object Subject, Thumbprint, NotAfter | Format-Table -AutoSize
- Capture the new certificate's thumbprint into a variable so you never have to paste it by hand. Filtering on a subject match and a future
NotAfteravoids grabbing the old certificate:
$newCert = Get-ChildItem -Path Cert:\LocalMachine\My | Where-Object {$_.Subject -like "*your-domain.com*" -and $_.NotAfter -gt (Get-Date)} $thumbprint = $newCert.Thumbprint Write-Host "Certificate Thumbprint: $thumbprint"
Get-ChildItem -Path Cert:\LocalMachine\My | Select-Object Subject, Thumbprint, NotAfter | Format-Table -AutoSize
$newCert = Get-ChildItem -Path Cert:\LocalMachine\My | Where-Object {$_.Subject -like "*your-domain.com*" -and $_.NotAfter -gt (Get-Date)}
$thumbprint = $newCert.Thumbprint
Write-Host "Certificate Thumbprint: $thumbprint"If the filter returns more than one certificate, tighten it (for example add a NotAfter comparison or match a more specific subject) so $thumbprint is a single value and not an array. If you copy the thumbprint from the MMC Details tab instead, delete any leading invisible character and all spaces before using it.
Update the SSL certificate on the primary ADFS server
Bind the new certificate and propagate it across the farm.
Run the SSL update on the primary ADFS server. On Windows Server 2016 and later this cmdlet propagates the binding to every farm member automatically.
- Set the new certificate (reuse the
$thumbprintvariable from the previous step, or paste the cleaned value):
Set-AdfsSslCertificate -Thumbprint $thumbprint
- Restart the ADFS service so the new binding is loaded:
Restart-Service adfssrv
- Confirm the service is running and the binding shows the new certificate hash.
Set-AdfsSslCertificate -Thumbprint $thumbprint
Restart-Service adfssrv
Get-Service adfssrv
Get-AdfsSslCertificateRun this on the primary node only; running it on secondaries is unnecessary and can cause confusion. If the cmdlet errors with an invalid or empty thumbprint, re-check that $thumbprint is a single clean 40-character string. Automatic propagation applies to Server 2016+, but you still restart secondary nodes explicitly in a later step.
Update the SSL certificate on Web Application Proxy servers
Apply the new certificate to each WAP node since they do not inherit it.
IIS Manager > Sites > Default Web Site > Bindings > https (443) > Edit > select certificateWAP servers do not inherit the SSL certificate from ADFS — you must update each WAP node individually after importing the new certificate there (done earlier).
- On each WAP server, set the new binding:
Set-WebApplicationProxySslCertificate -Thumbprint "YOUR_CERT_THUMBPRINT"
- If that command fails (for example after certificate changes on the ADFS side), reconfigure the proxy with the trust credential and the new thumbprint:
$cred = Get-Credential Install-WebApplicationProxy -FederationServiceName "adfs.yourdomain.com" -FederationServiceTrustCredential $cred -CertificateThumbprint "YOUR_CERT_THUMBPRINT"
- Update the IIS HTTPS binding manually if needed: open IIS Manager, go to Sites > Default Web Site > Bindings, edit the https (port 443) binding, and select the new certificate.
- Verify the WAP binding.
Set-WebApplicationProxySslCertificate -Thumbprint "YOUR_CERT_THUMBPRINT"
Get-WebApplicationProxySslCertificateReplace YOUR_CERT_THUMBPRINT and adfs.yourdomain.com with your values. The Install-WebApplicationProxy credential must be an account authorized to establish the proxy trust with ADFS. Repeat for every WAP server — a missed node will serve the old (soon-to-expire) certificate to external users.
Restart services on secondary ADFS servers
Force secondary nodes to load the new certificate binding.
Although Set-AdfsSslCertificate propagates the configuration to farm members, restart the service on each secondary ADFS node so it actually loads the new binding.
- On each secondary ADFS server, restart the service:
Restart-Service adfssrv
- Wait until the service reports Running before moving on:
- Check the AD FS admin log for certificate-related errors, and confirm each node reports the new certificate hash.
Restart-Service adfssrv
Get-WinEvent -LogName "AD FS/Admin" -MaxEvents 10 | Where-Object {$_.LevelDisplayName -eq "Error"}
Get-AdfsSslCertificate | Select-Object PortNumber, CertificateHashIf you use Microsoft Entra Connect (formerly Azure AD Connect), it can assist with farm-wide certificate updates, but restarting the service on each node is still the reliable way to guarantee the new binding is loaded. If a node's CertificateHash still shows the old value, re-check that the certificate and its private key permissions are present on that node.
Test and verify SSL certificate functionality
Confirm the new certificate serves correctly and authentication works.
Test every path end to end before considering the change complete.
- Open the ADFS sign-in test page in a browser and confirm there are no certificate warnings and the served certificate is the new one:
https://adfs.yourdomain.com/adfs/ls/IdpInitiatedSignOn.aspx
- Test the metadata endpoint from PowerShell:
- Inspect the certificate that is actually served:
- Sign in with a real test user through a relying-party application to confirm the full authentication flow works.
$response = Invoke-WebRequest -Uri "https://adfs.yourdomain.com/FederationMetadata/2007-06/FederationMetadata.xml" -UseBasicParsing
Write-Host "Status Code: $($response.StatusCode)"
Get-WinEvent -LogName "AD FS/Admin" -MaxEvents 50 | Where-Object {$_.TimeCreated -gt (Get-Date).AddHours(-1)}Replace adfs.yourdomain.com with your federation service name. You can also run an external SSL test (for example ssllabs.com/ssltest) to confirm the served chain and rating. Keep monitoring the AD FS/Admin event log over the next 24 hours — some certificate/binding issues only surface under real authentication load. Keep your rollback .pfx until you are confident everything is stable.
Confirm the new SSL certificate is bound across the farm
After completing every step, the whole farm should be serving the new certificate and authentication should work end to end. Do not rely on a single command — confirm the binding on the primary ADFS server, on each secondary ADFS node, and on every WAP server, then confirm the certificate that browsers and clients actually receive.
Run Get-AdfsSslCertificate on the primary and each secondary ADFS server and compare the returned CertificateHash (thumbprint) against the new certificate's thumbprint. Every port entry (typically 443, and 49443 for certificate authentication) should show the new hash. On each WAP server, Get-WebApplicationProxySslCertificate should return the same thumbprint. Finally, open https://adfs.yourdomain.com/adfs/ls/IdpInitiatedSignOn.aspx and inspect the served certificate — the subject, issuer, and expiry must match the new certificate with no browser warning.
The change is only truly confirmed when a test user can sign in successfully and the AD FS/Admin event log shows no certificate-related errors. Because binding or trust issues can surface after service restarts or token-signing cycles, keep watching that log for the next 24 hours.
Get-AdfsSslCertificateandGet-WebApplicationProxySslCertificateon every node return the new certificate's thumbprint on all listed ports. The ADFS sign-in page loads over HTTPS with no certificate warning and shows the new certificate's subject and expiry, a test user can authenticate, and theAD FS/Adminlog records no certificate errors.- A node still shows the old thumbprint, the browser shows a certificate warning or the previous certificate, WAP returns a different or empty thumbprint, or the
AD FS/Adminlog shows errors such as the certificate not being found or the private key being inaccessible. This usually means a service was not restarted, a WAP node was missed, the thumbprint contained hidden characters, or the ADFS service account lacks Read on the private key — revisit the relevant step or roll back to the exported .pfx. - Both ports show the same new thumbprint. A mismatched or old hash on either port means the node did not fully pick up the change.
- The WAP thumbprint must equal the ADFS thumbprint. An empty or old value means Set-WebApplicationProxySslCertificate did not apply and the node may need reconfiguration.
- The subject and future expiry confirm clients receive the new certificate, not the old one being retired.
- An empty result over the first hour — and ideally across 24 hours — indicates the new certificate bound cleanly with no private key or binding failures.
Troubleshooting
Set-AdfsSslCertificate fails with an invalid or not-found thumbprint error
Cause: The thumbprint string contains leading/trailing spaces or hidden characters (often introduced when copying from the MMC certificate details tab), or the certificate is not present in the Local Machine Personal store.
Re-capture the thumbprint programmatically instead of copy-pasting: $newCert = Get-ChildItem Cert:\LocalMachine\My | Where-Object {$_.Subject -like "*your-domain.com*" -and $_.NotAfter -gt (Get-Date)}; $thumbprint = $newCert.Thumbprint. Then pass the variable directly: Set-AdfsSslCertificate -Thumbprint $thumbprint. Confirm the certificate is in the store with Get-ChildItem Cert:\LocalMachine\My.
ADFS service fails to start or authentication breaks after the certificate change
Cause: The ADFS service account does not have Read access to the private key of the new certificate, so the service cannot bind it.
In the Certificates MMC, right-click the new certificate > All Tasks > Manage Private Keys and add the ADFS service account with Read permission. For a gMSA, click Object Types, enable Service Accounts, and enter DOMAIN\ADFS-Service$. Then restart the service with Restart-Service adfssrv and re-check Get-AdfsSslCertificate.
WAP servers still present the old SSL certificate after updating the primary ADFS server
Cause: Web Application Proxy servers do not inherit SSL certificate changes from the ADFS farm; each WAP node must be updated individually.
On every WAP server, import the certificate first, then run Set-WebApplicationProxySslCertificate -Thumbprint "YOUR_CERT_THUMBPRINT". If that command fails, reconfigure with Install-WebApplicationProxy -FederationServiceName "adfs.yourdomain.com" -FederationServiceTrustCredential $cred -CertificateThumbprint "YOUR_CERT_THUMBPRINT", and verify with Get-WebApplicationProxySslCertificate.
Secondary ADFS nodes still serve the old certificate even though the primary was updated
Cause: On Server 2016+ the binding propagates automatically, but the secondary node's running service may not reload the new binding until it is restarted.
Restart the service on each secondary node with Restart-Service adfssrv, wait until Get-Service adfssrv shows Running, then confirm the binding with Get-AdfsSslCertificate | Select-Object PortNumber, CertificateHash and compare the hash to the new certificate's thumbprint.
Browser shows a certificate warning on the ADFS sign-in page after replacement
Cause: An intermediate certificate is missing from the chain, or the certificate subject/SAN does not match the federation service name clients use.
Confirm the served certificate with $request = [System.Net.WebRequest]::Create("https://adfs.yourdomain.com"); $request.GetResponse().Close(); $request.ServicePoint.Certificate and check the subject and expiry. Ensure the full chain (including intermediates) was included in the .pfx, and validate externally at ssllabs.com/ssltest.
Frequently asked questions
Does Set-AdfsSslCertificate automatically update all ADFS servers in the farm?
Yes. Since Windows Server 2016, running Set-AdfsSslCertificate on the primary ADFS server propagates the new SSL certificate binding to all ADFS farm members automatically. You should still restart the service on secondary nodes so they reliably load the new binding.
Do I need to update Web Application Proxy servers separately?
Yes. WAP servers do not inherit SSL certificate changes from the ADFS farm. Import the certificate on each WAP node and run Set-WebApplicationProxySslCertificate -Thumbprint on every server individually.
Why does the Set-AdfsSslCertificate command fail with an invalid thumbprint error?
The most common cause is a thumbprint copied with spaces or hidden characters, or a certificate that is not in the Local Machine Personal store. Capture the thumbprint into a variable with Get-ChildItem Cert:\LocalMachine\My and pass that variable to the command instead of pasting the value.
What permissions does the ADFS service account need on the new certificate?
The ADFS service account needs at least Read access to the certificate's private key. Grant it via the Certificates MMC under All Tasks > Manage Private Keys; for a gMSA, enable the Service Accounts object type and add the account as DOMAIN\ADFS-Service$.
Do I have to restart the ADFS service after replacing the SSL certificate?
Yes, restart the ADFS service with Restart-Service adfssrv so the new certificate binding is loaded. Restart it on the primary and on each secondary node, then verify with Get-Service adfssrv and Get-AdfsSslCertificate.
Is the SSL certificate the same as the Service Communications certificate in ADFS?
They are configured separately but can be the same certificate for simplicity. The SSL certificate is set with Set-AdfsSslCertificate, while the Service Communications certificate is set in AD FS Management or with Set-AdfsCertificate -CertificateType Service-Communications.






