Microsoft services (Windows)¶
Agent 1.5.0 and later include bundled templates that install a renewed certificate in the Windows machine store and bind it to a Microsoft server role: Exchange, Remote Desktop, Routing and Remote Access, DirectAccess, SQL Server, Reporting Services, AD FS, Web Application Proxy, NPS and WinRM. In the desktop app they are listed under Microsoft services in Workflows → + New certificate workflow; they can also be assigned from the dashboard.
Not verified on a live server
These templates have not been run against a live server. The role commands were tested only against a mocked PowerShell boundary, and the bundled scripts were only checked by the PowerShell parser. Try each template on a test server, or in a maintenance window with a way back, before you rely on it. Of all the templates, the NPS policy edit is the riskiest.
How the templates work¶
Every template has the same shape:
- Obtain certificate - the certificate the Agent issued or renewed.
- Install in LocalMachine\My - the certificate and its key go into the machine Personal store, not exportable. Where a service runs as its own account, the step also grants that account read access to the private key (see Service accounts).
- Bind to
- the new windows_service.bindstep runs a fixed PowerShell script that is bundled with the Agent for that service. - Inspect the TLS endpoint and Confirm new certificate - only for the templates with a verification port, and only when Verification hostname (optional) is set: the Agent connects to the endpoint and checks that it serves the new certificate. A mismatch rolls the binding back.
The bind step runs elevated as the Agent service. The scripts are part of the signed Agent; there is no way to change them or add your own. The settings of a workflow are passed to the script as data on standard input, never pasted into the script or the command line, so a value cannot change what the script runs. The script reports the previous certificate it replaced; when a later step fails, rollback binds that previous certificate again. The script may run for 120 seconds (600 seconds for Exchange), and the bind step allows 60 seconds more.
A template description in the desktop app and in the dashboard says what it changes, what it restarts and how rollback works, and ends with Not verified on a live server: the role commands were tested only against a mocked PowerShell boundary.
Templates¶
| Template | Changes | Restarts | Rollback | Script timeout |
|---|---|---|---|---|
Exchange Server (exchange) |
Enables the certificate for the selected Exchange services with Enable-ExchangeCertificate (Exchange Management Shell). |
IIS (iisreset /noforce) only when IIS is selected and changed. |
Previous certificate enabled again. | 600 s |
Exchange Server hybrid connectors (exchange-hybrid) |
As Exchange, then sets the certificate as the TLS certificate name of the named hybrid send and, optionally, receive connector (Set-SendConnector, Set-ReceiveConnector -TlsCertificateName). Nothing changes on the Exchange Online side. |
None, unless IIS is selected. | Previous TLS certificate name; a connector failure restores the connectors already changed. | 600 s |
Remote Desktop Gateway (rd-gateway) |
RD Gateway SSL certificate (RDS:\GatewayServer\SSLCertificate). |
TSGateway, which drops gateway connections briefly. | Previous thumbprint. | 120 s |
Remote Desktop listener (RDP) (rdp-listener) |
Win32_TSGeneralSetting.SSLCertificateSHA1Hash of the listener; grants the Remote Desktop service account read access to the key. |
None; new connections use the certificate. | Previous hash. | 120 s |
Remote Desktop Services deployment (rds-deployment) |
Set-RDCertificate on the RD Connection Broker for the selected roles: RD Gateway, RD Web Access, RD Connection Broker redirector and publishing. |
The RemoteDesktop module applies the certificate to each role itself. | Previous certificate per role (see Known limits). | 120 s |
Routing and Remote Access SSTP VPN (rras-sstp) |
Remote Access SSL certificate for SSTP (Set-RemoteAccess -SslCertificate), also for an Always On VPN device tunnel over SSTP. |
RemoteAccess, which drops VPN connections (optional). | Previous certificate. | 120 s |
Routing and Remote Access IKEv2 VPN (rras-ikev2) |
Nothing is bound: RRAS selects the machine certificate itself by its Server Authentication EKU and name. The step checks that RRAS VPN is configured (Get-VpnServerConfiguration) and that the certificate can be selected. Also for Always On VPN user and device tunnels. |
RemoteAccess only when selected (off by default). | Not applicable (store install only). | 120 s |
DirectAccess IP-HTTPS (deprecated) (directaccess-iphttps) |
DirectAccess IP-HTTPS certificate (Set-RemoteAccess -SslCertificate). |
RemoteAccess, which drops DirectAccess connections (optional). | Previous certificate. | 120 s |
SQL Server (sql-server) |
The instance's TLS certificate (registry SuperSocketNetLib\Certificate); grants the SQL Server service account read access to the key. |
The instance service only when selected; otherwise SQL Server uses the certificate from its next restart. | Previous registry value. | 120 s |
SQL Server Reporting Services (ssrs) |
Replaces the certificate of the existing Reporting Services SSL bindings on the IP address and port (MSReportServer_ConfigurationSetting). |
Reporting Services (optional). | Previous binding. | 120 s |
AD FS (adfs) |
AD FS SSL and service communications certificate (Set-AdfsSslCertificate, Set-AdfsCertificate -CertificateType Service-Communications); grants the AD FS service account read access to the key. |
adfssrv (optional). | Previous certificate; if the second change fails, the SSL certificate is set back. | 120 s |
Web Application Proxy (AD FS proxy) (adfs-wap) |
Web Application Proxy SSL certificate (Set-WebApplicationProxySslCertificate). |
None. | Previous certificate (read from the federation host's HTTP.sys binding on 443). | 120 s |
Network Policy Server (PEAP / EAP-TLS) (nps) |
Replaces the server certificate in the EAP configuration of the named network policy (netsh nps export, edit, import); grants the NPS service account read access to the key. |
NPS (IAS) (optional). | The previous certificate is put back into the policy. | 120 s |
WinRM HTTPS listener (winrm-https) |
CertificateThumbprint of the existing WinRM HTTPS listener (WSMan provider). |
None. | Previous thumbprint. | 120 s |
Microsoft has deprecated DirectAccess; plan a move to Always On VPN. The DirectAccess template is there for existing deployments.
Setup fields¶
Templates with an endpoint check (Exchange, RD Gateway, RDS deployment, RRAS SSTP, DirectAccess, SSRS, AD FS, Web Application Proxy: port 443; WinRM HTTPS: port 5986) also have Verification hostname (optional) - a hostname the service presents on TLS and the certificate covers; leave it empty to skip the check - and Verification port (for SSRS HTTPS port, the port of the existing HTTPS binding, which the check uses too). A Restart … after a change switch restarts the service at once (connections drop briefly); off means the service uses the certificate after its next restart.
| Template | Fields (default) |
|---|---|
| Exchange Server | Use for IIS (Outlook on the web, EWS, ActiveSync) (on), Use for SMTP (on), Use for IMAP4 (off), Use for POP3 (off) |
| Exchange Server hybrid connectors | The same four switches with IIS off by default, Send connector (required, for example Outbound to Office 365 - <GUID>), Receive connector (optional) (for example Default Frontend EX01; empty changes only the send connector) |
| Remote Desktop Gateway | Restart RD Gateway (TSGateway) after a change (on) |
| Remote Desktop listener (RDP) | Remote Desktop listener (RDP-Tcp), Account that reads the private key (NT AUTHORITY\NETWORK SERVICE) |
| Remote Desktop Services deployment | RD Gateway role, RD Web Access role, RD Connection Broker: enable single sign-on, RD Connection Broker: publishing (all on), RD Connection Broker (optional) (the broker's DNS name; empty when this computer is the broker) |
| RRAS SSTP / DirectAccess | Restart Routing and Remote Access after a change (on) |
| RRAS IKEv2 | Restart Routing and Remote Access after a change (off) |
| SQL Server | SQL Server instance (MSSQLSERVER, or the named instance), Account that reads the private key (required, no default; for example NT SERVICE\MSSQLSERVER or NT SERVICE\MSSQL$SALES), Restart the SQL Server instance after a change (off) |
| SQL Server Reporting Services | Reporting Services instance (SSRS; PBIRS for Power BI Report Server), Binding IP address (0.0.0.0), restart (on) |
| AD FS | Account that reads the private key (required; for example CONTOSO\gmsa-adfs$), Restart AD FS (adfssrv) after a change (on) |
| Web Application Proxy | None of its own |
| Network Policy Server | Network policy (required), Account that reads the private key (NT AUTHORITY\NETWORK SERVICE), Restart NPS (IAS) after a change (on) |
| WinRM HTTPS listener | Listener address (* or IP:<address>) |
Service accounts and private key access¶
Some services read the private key under their own account rather than as
LocalSystem. Their templates fill the store installation step's new
read_principals input from Account that reads the private key, so the
account gets read access to that one key. Nothing is guessed: enter a Windows
account name such as DOMAIN\name, NT SERVICE\name or
NT AUTHORITY\NETWORK SERVICE. The desktop app checks the value as a Windows
account name when you save, and the Agent checks it again when the step runs.
In your own workflows, windows_cert_store.install accepts read_principals
(up to 16 account names; see
step action inputs).
Prerequisites¶
- Exchange: run the Agent on the Exchange server; the script loads the Exchange Management Shell snap-in.
- Remote Desktop Services deployment: run it on the RD Connection Broker, or name the broker.
- RRAS and DirectAccess: the role must already be installed and configured (The Routing and Remote Access VPN role is not installed and configured. / DirectAccess is not installed and configured on this server.). For IKEv2, clients must trust the issuing CA and match the server name, and the certificate needs the Server Authentication EKU.
- SSRS: the HTTPS URL must already exist (add it in Report Server Configuration Manager first); otherwise the step fails with Reporting Services has no SSL binding on IP:PORT.
- WinRM: an existing HTTPS listener whose Hostname matches the certificate; the template does not create one (There is no WinRM HTTPS listener at address X.).
- AD FS: run a workflow on every AD FS server of the farm.
Known limits¶
- RDS deployment restores a single previous thumbprint, and only when all selected roles shared it.
- SQL Server without a previous certificate is not restored to "no certificate" by rollback.
- Exchange rollback timing: the Agent allows a rollback step 2 minutes, less than the 600 seconds an Exchange binding may take.
- NPS: the policy export also holds the RADIUS shared secrets. It is kept in a folder only SYSTEM and Administrators can open and deleted afterwards.
- RRAS IKEv2 binds nothing and has no rollback.
Finding the right template¶
In the desktop app, Detect servers on this computer… in the new-workflow template dialog lists the Remote Desktop, RD Gateway, Remote Access and WinRM bindings it finds and pre-fills the matching template (read-only, no administrator prompt). See Server detection.