Automate certificate renewal on SQL Server and AD FS

SQL Server and AD FS can both renew certificates with built-in mechanisms, but each needs specific steps, restarts and partner updates. This page covers how to automate them and what goes wrong.

On this page

How can SQL Server and AD FS certificate renewal be automated, and what do shorter lifetimes change?

SQL Server and AD FS certificates can both be renewed through Windows tooling and configuration cmdlets, but the work is different for each. For SQL Server, the TLS certificate is set in SQL Server Configuration Manager or the registry key SuperSocketNetLib\Certificate, and a replacement must sit in the local computer store or the service account store, be within its validity dates, carry the Server Authentication EKU, and be readable by the SQL Server service account. For AD FS, Microsoft documents the Set-AdfsSslCertificate cmdlet for the TLS certificate and Update-ADFSCertificate for token signing certificates. The public maximum lifetime for subscriber certificates falls to 200 days from 15 March 2026, 100 days from 15 March 2027 and 47 days from 15 March 2029, as set in the CA/Browser Forum Baseline Requirements.

Those shorter lifetimes mean manual renewal will not keep up. A 47-day certificate has to be replaced roughly eight times a year on every server that holds it, and each replacement is a chance to miss a step. Plan the renewal around the restarts it triggers. SQL Server will not start if a manually configured certificate meets only some of the requirements, and the service must be restarted after changes to Force Encryption. In an availability group or failover cluster, the certificate must be installed on every replica or node, so each one needs the same work scheduled.

AD FS needs the most planning because federation partners must trust the new token signing certificate before it is used. Microsoft says partner updates should be planned at least 60 days ahead, and that with AutoCertificateRollover set to True, every partner must be updated to avoid an outage. At 47 days that window can be longer than the certificate itself, so confirm with your partners how they receive metadata updates before you choose a rollover approach. Check Get-AdfsProperties and the thresholds it reports, and confirm that the cmdlets can reach every farm node through PowerShell Remoting on TCP port 5985.

What the lifetime schedule changes for SQL Server and AD FS renewals

This table pairs each dated step in the CA/Browser Forum schedule with what it means for how often you renew certificates on SQL Server and AD FS. Read each row against the platform column, and note that the schedule covers publicly trusted subscriber certificates, while AD FS token certificates and SQL Server internal certificates may come from a private CA or be self-signed, so confirm which applies to your estate before planning. The main takeaway is that the shorter lifetimes and reuse periods move renewal from an occasional task to a routine one that needs automation and a planned restart or partner update.

DateMaximum certificate validityWhat it means for SQL Server and AD FS
From 15 March 2026200 daysPublicly trusted TLS certificates renew roughly every 200 days at most. Confirm whether your SQL Server certificate is publicly trusted or internal before changing schedules.
From 15 March 2026Domain and IP validation reuse: 200 daysValidation data can be reused for up to 200 days, so re-validation happens less often than the certificate lifetime limit itself.
From 15 March 2026Subject identity reuse: 398 daysSubject identity information may be reused for up to 398 days, which applies to the organization details tied to the certificate.
From 15 March 2027100 daysPublicly trusted certificates renew about every 100 days at most, doubling the renewal frequency from the 200-day step.
From 15 March 2027Domain and IP validation reuse: 100 daysDomain and IP validation data reuse drops to 100 days, matching the certificate lifetime step.
From 15 March 202947 daysPublicly trusted certificates renew about every 47 days at most, so manual renewal on SQL Server and AD FS is unlikely to keep pace.
From 15 March 2029Domain and IP validation reuse: 10 daysDomain and IP validation data may be reused for only 10 days, so validation must be repeated almost each time a certificate renews.
All dates (AD FS token certificates)Set by AutoCertificateRollover, not the CA/B Forum scheduleToken certificates generated by AD FS follow its own rollover thresholds. Plan partner updates at least 60 days ahead, as Microsoft advises.
All dates (SQL Server internal certificates)Depends on the issuing CA or self-signed generationInternal or self-signed SQL Server certificates may not fall under the public schedule. Confirm the issuing source and its lifetime policy.

How SQL Server selects and loads its TLS certificate

SQL Server does not pick a TLS certificate by name alone. It works through a fixed order. First it uses the certificate set in SQL Server Configuration Manager, or the thumbprint stored under the SuperSocketNetLib\Certificate registry key. If neither is set, it looks for a certificate in a store whose subject contains the machine's fully qualified domain name and which the SQL Server service account can read. If it finds none, it generates a self-signed certificate. For renewal work, the practical point is that an explicit configuration always wins, so a renewed certificate installed beside an old pinned thumbprint will not be used until that setting is changed. Check the configured value before you assume the new certificate is active.

The certificate must sit in either the local computer store or the SQL Server service account store, be inside its Valid from and Valid to dates, carry the Server Authentication enhanced key usage (1.3.6.1.5.5.7.3.1), and be readable by the service account. It must also be created with KeySpec AT_KEYEXCHANGE, which requires a legacy cryptographic provider. Certificates from a Key Storage Provider use KeySpec 0 and are not compatible with SQL Server, so a renewal request that goes through a KSP-based template will fail here. Microsoft says SQL Server will not start if a manually configured certificate meets only some of these requirements. Run certutil -v -store My "<certificate_thumbprint>" against the candidate certificate before you change the configuration, and confirm the service account can read the private key.

On an availability group or failover cluster, the certificate must be installed on every replica or node, and Configuration Manager must run under a local administrator account. Starting with SQL Server 2022 CU22 and SQL Server 2025, the certificate thumbprint in the registry is no longer case sensitive, so scripts that compare thumbprints as exact strings should be reviewed before rollout. SQL Server also checks validity only at configuration time and keeps running after expiry, but validating clients fail a full TLS handshake, while clients using TrustServerCertificate=true keep working. Confirm the renewal date for each instance and plan the restart that applies the new setting.

Which automation paths exist for SQL Server and AD FS

SQL Server can take a new TLS certificate in two ways: through SQL Server Configuration Manager, which integrates certificate management in SQL Server 2019 and later, or by manual replacement that follows Microsoft's certificate requirements. Either way the certificate has to sit in the local computer store or the SQL Server service account store, be inside its Valid from and Valid to dates, carry the Server Authentication EKU 1.3.6.1.5.5.7.3.1, and be readable by the SQL Server service account. Microsoft also says the certificate must be created with KeySpec AT_KEYEXCHANGE, which needs a legacy cryptographic provider, and that certificates from a Key Storage Provider use KeySpec 0 and are not compatible with SQL Server.

  • Configuration Manager path: Configuration Manager must run with a local administrator account. For an availability group or failover cluster, the certificate must be installed on every replica or node before the change.
  • Manual path: SQL Server will not start if a manually configured certificate meets only some of the requirements. Check the certificate with certutil -v -store My "<certificate_thumbprint>" before restarting.
  • Restart requirement: Forcing encryption means setting Force Encryption to Yes on the Flags tab under Protocols and restarting the SQL Server service, so plan a maintenance window.
  • Load order: SQL Server uses the certificate set in Configuration Manager or the registry key SuperSocketNetLib\Certificate first, then a store certificate with the machine FQDN in its subject, and otherwise generates a self-signed certificate. A forgotten setting can silently fall back.
  • Expiry behaviour: SQL Server checks validity only at configuration time and keeps running after expiry, but validating clients doing a full TLS handshake fail. Clients using TrustServerCertificate=true continue to work, which can hide the problem.

Before a change, confirm the thumbprint format for your build: from SQL Server 2022 CU22 and SQL Server 2025 the registry thumbprint is no longer case sensitive. Check the exact procedure in your version's Microsoft documentation.

Work order for replacing a SQL Server certificate

This sequence replaces the TLS certificate SQL Server presents to clients so that the new certificate is installed on every node, selected in Configuration Manager and loaded at service restart. Each step ends with a check, so the team knows the certificate is valid and the instance is serving it before the old one is retired. Work through the steps on each replica or cluster node in turn.

  1. Confirm the certificate meets the requirements

    The engineer confirms the new certificate is in the local computer store or the SQL Server service account store, is within its Valid from and Valid to dates, carries the Server Authentication EKU 1.3.6.1.5.5.7.3.1, and is readable by the SQL Server service account. The engineer also confirms it was created with KeySpec AT_KEYEXCHANGE, since certificates from a Key Storage Provider use KeySpec 0 and are not compatible with SQL Server. The step is done when each of these checks has been recorded against the certificate. Confirm each item against Microsoft's SQL Server certificate requirements page, because the list may change between releases.

  2. Verify the certificate with certutil

    The engineer runs certutil -v -store My "<certificate_thumbprint>" on each node, replacing the placeholder with the thumbprint of the new certificate. The output should show the certificate with the Server Authentication usage and the key spec the requirements call for, with no errors. Microsoft notes that SQL Server will not start if a manually configured certificate meets only some of the requirements, so a partial result here is a stop condition. The step is done when the output on every node has been reviewed and matches the checklist from the previous step.

  3. Install the certificate on every replica or node

    For a standalone instance, the engineer installs the certificate into the local computer store on that server. For an availability group or failover cluster, the certificate must be installed on every replica or node, so the engineer repeats the installation on each one and confirms the certificate's thumbprint matches across all of them. Microsoft states this requirement for SQL Server 2019 and later. The step is done when the same thumbprint is present and passes certutil on every node in the group.

  4. Select the certificate in Configuration Manager

    The engineer opens SQL Server Configuration Manager under a local administrator account, since the tool must run that way, and selects the instance's protocol settings. In the certificate field, the engineer selects the new certificate for the instance. Configuration Manager in SQL Server 2019 and later integrates certificate management, so this selection is made there rather than by editing the registry by hand. The step is done when the instance shows the new certificate as its configured certificate on each node.

  5. Set Force Encryption if the policy requires it

    If the organization's policy requires encrypted connections, the engineer sets Force Encryption to Yes on the Flags tab under Protocols for the instance in SQL Server Configuration Manager. This step is needed only where the policy calls for it, so the engineer checks the requirement first. Before enabling it, the engineer confirms that client applications can validate the new certificate, since clients doing a full TLS handshake depend on it. The step is done when the Flags setting is recorded for each instance and matches the policy.

  6. Restart the SQL Server service

    The engineer restarts the SQL Server service on each node so the instance loads the newly selected certificate. The restart should be planned with the owners of dependent applications, because connections will be interrupted while the service stops. For clustered or availability group setups, the engineer follows the failover order the team has agreed. The step is done when the service is running and the instance reports the new certificate after the restart.

  7. Confirm the instance serves the new certificate

    The engineer checks that a client connection completes a full TLS handshake against the instance and that the certificate presented is the new one, identified by its thumbprint. For a validating client, the check should succeed, and the engineer should note any client still using TrustServerCertificate=true, which continues to work regardless. The check also confirms the old certificate is no longer selected in Configuration Manager. The step is done when the handshake and thumbprint match have been recorded for every node.

What has to be in place before renewal runs

Renewal on these two services fails quietly if the certificate is in the wrong store, the wrong key provider, or unreadable by the service account. Confirm the items below on every node first, then automate the restart and verification steps.

Certificate store and key provider

The SQL Server certificate must sit in the local computer store or the SQL Server service account store, and it must be created with KeySpec AT_KEYEXCHANGE, which requires a legacy cryptographic provider. Certificates from a Key Storage Provider use KeySpec 0 and are not compatible with SQL Server, so a renewal request that uses a KSP template will produce a certificate SQL Server cannot use. Check the template and the provider before issuing. Verify a manual certificate with certutil -v -store My "<certificate_thumbprint>" and confirm the Server Authentication EKU is present.

Certificate requirements

Service account read access to the key

The SQL Server service account and the AD FS service account must both be able to read the private key of the certificate they use. A certificate that is valid but unreadable by the service account will not be loaded. SQL Server will not start if a manually configured certificate meets only some of the requirements, so a missing permission can take the instance down at restart. Grant read access on the new certificate's private key before the old one is removed.

Local administrator rights for Configuration Manager

In SQL Server 2019 and later, certificate management is integrated into SQL Server Configuration Manager, and that tool must run under a local administrator account. Automation that runs under a lower-privileged account will fail when it tries to change the certificate or the Force Encryption setting. For an availability group or failover cluster, the certificate must be installed on every replica or node, so confirm rights on each one.

SQL Server encryption

TCP 5985 open across the AD FS farm

AD FS cmdlets that change the TLS certificate update every farm node through PowerShell Remoting, which uses TCP port 5985. If that port is blocked between the primary and the secondary servers, the change will apply to some nodes and not others. Confirm connectivity on port 5985 between all farm nodes before scheduling the renewal, and check that the change reached each node afterward.

Manage AD FS SSL certificates

Primary server version in a 2016 farm

On a Windows Server 2016 AD FS farm, the primary server must itself run Windows Server 2016. The cmdlets that replace the TLS certificate run on the primary and push the change to the other nodes, so a primary on a different version breaks the procedure. Identify which server holds the primary role before you plan the renewal window, and document it so the automation targets the right host.

How to confirm SQL Server and AD FS renewals keep happening

A renewal only counts once you can show that the new certificate is in place and that nothing is about to expire behind it. For AD FS, start by checking expiry dates on the token signing and token decrypting certificates with Get-ADFSCertificate -CertificateType token-signing, and confirm the TLS certificate with certutil -v -store My "<certificate_thumbprint>" on each server. Then review the rollover settings with Get-AdfsProperties and read the values of AutoCertificateRollover, CertificateGenerationThreshold and CertificatePromotionThreshold. Those two thresholds tell you how many days before expiry a new certificate is generated and how many days later it becomes primary. If AutoCertificateRollover is False, the renewals you expect will not happen on their own, so treat that as an open item rather than a setting to assume is fine.

Rollover is only half the job. Each federation partner must trust the new token signing certificate before the old one is retired, and Microsoft's guidance is to plan those partner updates at least 60 days ahead. Confirm this for every relying party, not just the ones you remember, and keep the result with the change record. Keep a dated log of each thumbprint change for both AD FS and SQL Server: the old and new thumbprints, the date each became primary, who approved it, and the partners confirmed. Auditors and customer security reviews tend to ask for exactly this trail.

SQL Server needs separate attention. Microsoft says the instance checks certificate validity only when it is configured and keeps running after the certificate expires, so a lapsed certificate will not stop the service or raise an alert inside SQL Server itself. Clients that do a full TLS validation will start failing instead, while clients using TrustServerCertificate=true keep connecting. Monitoring therefore has to come from outside the service: a scheduled check of the certificate's Valid to date on every replica or cluster node, and an alert set well before that date. Confirm the thresholds and any alerting options against the current Microsoft documentation for your SQL Server version.

Common questions about SQL Server and AD FS certificate renewal

Does AD FS renew its token certificates automatically?

Yes, by default. Microsoft says AD FS generates token signing and token decryption certificates automatically, and this behavior is controlled by the AutoCertificateRollover property, which you can view with Get-AdfsProperties. When that property is True, the CertificateGenerationThreshold setting controls how many days before the Not After date a new certificate is generated, and CertificatePromotionThreshold controls how many days after generation it becomes primary. Automatic rollover does not remove the need for planning. Every federation partner must be updated to trust the new certificate, or sign-ins will fail. Check your current threshold values and your partner update process before relying on the default. If you use a CA-issued certificate, Microsoft describes a different manual procedure that disables automatic rollover first.

How far ahead do federation partners need to be updated for AD FS?

Microsoft says to plan partner updates at least 60 days ahead of a token signing certificate change. This applies when you generate a new token signing certificate manually with Update-ADFSCertificate -CertificateType token-signing, and it is the lead time Microsoft states in its guidance. The window matters because each partner relying party must receive the new certificate before it becomes primary. Your partners may need their own change windows, so start coordination early and confirm the new certificate with Get-ADFSCertificate -CertificateType token-signing on your primary server before you announce the change. Ask each partner to confirm receipt and their test results in writing.

Does SQL Server restart when its certificate expires?

No, not immediately. Microsoft says SQL Server checks certificate validity only at configuration time and keeps running when the certificate later expires. The effect appears on the client side: validating clients that perform a full TLS handshake will fail to connect. Clients that set TrustServerCertificate=true continue to work because they skip that validation. This means an expired certificate can cause a sudden outage for some applications while the service itself stays up. Plan the renewal so the new certificate is installed and the SQL Server service is restarted at a planned time, and confirm which connection strings in your environment validate the certificate.

Does a certificate from a Key Storage Provider work with SQL Server?

No. Microsoft says the SQL Server certificate must be created with KeySpec AT_KEYEXCHANGE, which requires a legacy cryptographic provider. Certificates from a Key Storage Provider use KeySpec 0 and are not compatible with SQL Server. Check how your current certificate was issued before you plan the renewal, because a certificate request template or tool that uses a Key Storage Provider will produce a certificate SQL Server cannot use. Confirm the requirements against Microsoft's certificate requirements page for the SQL Server version you run.

What happens if a manually installed SQL Server certificate is incomplete?

SQL Server will not start. Microsoft says the service will not start if a manually configured certificate meets only some of the requirements. Those requirements include being in the local computer store or the SQL Server service account store, being within its Valid from and Valid to dates, carrying the Server Authentication EKU 1.3.6.1.5.5.7.3.1, and being readable by the SQL Server service account. To check a certificate, run certutil -v -store My "<certificate_thumbprint>", replacing the placeholder with the thumbprint. Test the change on a non-production instance first, and keep the previous certificate available so you can restore service if the new one fails.

Do SQL Server availability groups need the certificate on every replica?

Yes. Microsoft says that for an availability group or failover cluster, the certificate must be installed on every replica or node. In SQL Server 2019 and later, SQL Server Configuration Manager integrates certificate management, and Microsoft says it must run with a local administrator account. Install the certificate on each node, confirm it meets the requirements on each one, and then restart the service in the order your cluster design requires. Missing a replica can leave one node unable to accept encrypted connections after failover.

Should we get outside help for SQL Server and AD FS certificate renewal?

It depends on how much of the work your team can own. The renewal involves certificate issuance, partner coordination, service restarts and testing across replicas and federation partners, so the effort is mostly in planning and verification. Your in-house team is well placed if it already runs AD FS and SQL Server and has a documented change process. Outside help is worth asking about when you have many partners, multiple availability group replicas, or a certificate authority arrangement you have not operated before. A written scope should name the systems covered, the deliverables and who performs each restart. DeployOpen plans, implements and documents this kind of work on self-hosted platforms in your infrastructure, under a fixed scope agreed in writing before work begins. It does not publish a price list, and a quote follows from that scope.

How a renewed certificate reaches SQL Server and AD FS

The path starts with either AD FS auto-generating a new token signing or token decryption certificate, or an administrator installing a renewed TLS certificate into the local computer store or the service account store. For SQL Server, the certificate must be selected in SQL Server Configuration Manager and the service restarted on every replica or cluster node. For AD FS, the new certificate must reach every federation partner before the old one expires, and the AD FS cmdlets push the TLS change to all farm nodes over PowerShell Remoting, so port 5985 must be open. Check the certificate's requirements and store location at each hand-off.

Renewed certificates move from the store or AD FS to the running service and its partners.

How DeployOpen helps with SQL Server and AD FS certificate automation

DeployOpen scopes SQL Server and AD FS certificate renewal in writing before any work starts, so the service restarts, certificate locations and partner updates are agreed up front. We then build and test the renewal path in your environment, using the certificate requirements and cmdlets Microsoft documents for each service. Each engagement ends with documentation and a handover your team can run.

How we scope

  • We inventory every SQL Server instance and AD FS farm in the agreed scope, including replicas, cluster nodes and federation partners.
  • We record which certificate each service uses, where it is stored and which service account must be able to read it.
  • The written scope names the restart windows, approval steps and partner update dates that renewal will require for your estate.

How we build

  • We build renewal against the SQL Server certificate requirements, checking Server Authentication EKU, validity dates and KeySpec before installation.
  • For AD FS, we configure token signing and TLS certificate changes with the documented cmdlets and verify each farm node afterward.
  • We test renewal in a non-production copy first, then document the steps and the checks that confirm each service is healthy.

How we hand over

  • You receive runbooks covering SQL Server Configuration Manager steps, AD FS cmdlet sequences and the verification commands used during testing.
  • Handover includes the list of replicas, nodes and federation partners, with the owner and schedule for each renewal action.
  • Your team runs a supervised renewal cycle with us before the engagement closes, so the procedure is proven in your environment.

How we support

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work begins.
  • Ongoing support, upgrades and continuous testing are available as a retainer for renewals that recur across your Windows estate.
  • Confirm the exact cmdlets, ports and product version requirements for your farm against Microsoft's current documentation before scheduling changes.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.