Skip to content

Command line

Manage certificates for IIS: from Let's Encrypt or any ACME certificate authority, renewed automatically, or bought elsewhere and installed safely.

Run SSLense.Cli in an elevated terminal: every command except --help needs Administrator rights. Add --help to any command to see this in the terminal, and --json to any command for one JSON document instead of text (see the automation guide).

This page is generated from the command line itself (src/SSLense.Cli/CliReference.cs); do not edit it by hand.

List IIS sites and their bindings.

Obtain and install a certificate, validated over HTTP or DNS.

Option Description
--validation How to prove control of the host names: http (the default, needs an HTTP binding on port 80), http-self (SSLense answers on port 80 itself, so only a binding for the host is needed), dns (a provider added with 'dns add'), or dns-manual (records you create by hand; no automatic renewal).
--site IIS site name.
--no-site Issue a certificate with no IIS site, under this name, for Remote Desktop, SQL Server, or other services its deployment steps hand it to. Needs --names, and DNS validation or --validation http-self.
--exportable-key Install the private key as exportable, so deployment steps can export it to PFX or PEM files, or the IIS Central Certificate Store. Kept at every renewal.
--key The key type: ecdsa-p256 (default), ecdsa-p384, rsa-2048, rsa-3072, or rsa-4096. Kept at every renewal.
--preferred-chain The root the chain should end at, as the CA names it, such as "ISRG Root X1". The default chain is used when the CA offers none to it.
--profile An ACME profile the CA offers, such as shortlived at Let's Encrypt. 'ca test' lists them.
--reuse-key Keep the same private key at every renewal, for key pinning or DANE. The first certificate gets a new key.
--names Comma-separated names for the certificate to cover, such as "*.example.com,example.com". Needs DNS validation. Defaults to the host names.
--hosts Comma-separated host names to bind in IIS. Defaults to the site's named HTTP bindings, and with DNS validation its named HTTPS bindings too. With --names, only the bindings those names cover.
--email Required. Email address for the ACME account with the certificate authority.
--staging Use Let's Encrypt staging (the safe default).
--production Use Let's Encrypt production and obtain a publicly trusted certificate.
--accept-production-risk Confirm issuing a trusted certificate: Let's Encrypt production or any CA not marked as a test. Its limits apply, and it replaces the live IIS binding.
--ca The certificate authority to issue from, by ID: letsencrypt-staging (the default), letsencrypt, or one added with 'ca add'. See 'ca list'.
--output Directory for the public certificate PEM. Private-key PFX files are not persisted.
--force Replace an existing valid certificate for the requested hosts.

Configure the ACME certificate authorities SSLense can issue from. Let's Encrypt is built in.

List the certificate authorities, and the sites that renew with each.

Add a certificate authority. SSLense reads its ACME directory first, and saves nothing if it cannot be used.

Option Description
--preset A known certificate authority: zerossl, google, google-test, sslcom, sectigo.
--name For any other CA: its name. With --preset, a different name to show.
--directory For any other CA: its ACME directory URL, starting with https://.
--id The ID to give --ca. From the preset or the name when left out.
--test For any other CA: its certificates are not trusted by browsers, so issuing from it asks no confirmation.
--eab Prompt for External Account Binding credentials from your account with the CA: the key ID, then the HMAC key without echo.
--caa-domain The domain the CA looks for in CAA records, for a CA whose directory does not publish it.

Read the CA's directory and report what it requires and offers. Creates no account and changes nothing.

Option Description
--ca Required. The certificate authority to check, by ID.

Remove a certificate authority that no certificate renews with. Its ACME account key is kept, so adding it again reuses the account.

Option Description
--ca Required. The certificate authority to remove, by ID.

Configure the DNS zones SSLense can publish validation records in.

List the configured DNS providers.

Add a DNS provider. For Cloudflare, the API token is prompted without echo; use a token with Zone > DNS > Edit on this one zone, because it can change every record in the zone. For a script, read it before adding it: the renewal service runs it as SYSTEM. For acme-dns, SSLense registers an account and shows the one CNAME to create at your DNS host.

Option Description
--provider Required. The DNS service: cloudflare, route53, azure, google, digitalocean or hetzner; script, for your own PowerShell script that works with any DNS service; or acme-dns, for an account on an acme-dns server reached through one CNAME.
--name Required. A label for this provider.
--zone Cloudflare and script: the DNS zone, such as example.com.
--domain acme-dns only: the domain whose _acme-challenge CNAME will point to the account, such as example.com. It also covers *.example.com.
--server acme-dns only: the server, such as https://auth.acme-dns.io, the free public one, or your own.
--allow-from acme-dns only: comma-separated networks that may update the account, such as this server's address, 203.0.113.10/32.
--import acme-dns only: use an account another tool registered. Prompts for its username, subdomain, and full domain, and its password without echo.
--zone-id cloudflare: the zone ID, from the domain's Overview page. route53: the hosted zone ID. azure: <subscription ID>/<resource group>. google: the managed zone's name.
--script Script only: your .ps1 file. SSLense runs its own copy, so later changes to this file need 'dns update-script'.
--secret Script only: prompt for one secret, such as an API key, given to the script when it runs.
--timeout Script only: seconds one call may run before it is stopped. Default 120.
--key-file google only: the service account key's JSON file.

Take a new copy of a provider's script, after you changed it. The new copy is checked first; if it fails, the old copy stays in use.

Option Description
--name Required. The script provider whose script changed.
--script Required. The .ps1 file to copy.

Prove the provider can change the zone, by adding and removing a temporary TXT record. For a script, SSLense also waits until every authoritative name server returns the record. For acme-dns, SSLense checks the CNAME, updates the account, and waits until its name servers return the value.

Option Description
--name Required. The DNS provider to test.

Replace a provider's API token, or a script's secret, for one that expired or was rotated. It is prompted without echo.

Option Description
--name Required. The DNS provider whose token to replace.

Remove a DNS provider that no certificate renews through. Revoke its token in the DNS service too.

Option Description
--name Required. The DNS provider to remove.

Let several IIS sites use one certificate, renewed together. The certificate must use DNS validation.

Bind another IIS site to a certificate. Nothing is sent to the certificate authority.

Option Description
--from Required. An IIS site already using the certificate.
--to Required. The IIS site to add.
--hosts Comma-separated hosts to bind (default: the site's named bindings that the certificate covers).
--replace-existing The site has its own certificate: replace it, and stop managing that one.

Stop managing one IIS site of a shared certificate. Its HTTPS binding is not changed.

Option Description
--site Required. The IIS site to stop managing.

Steps that run after every install and renewal of a certificate: key access, service restarts, and scripts.

Add a step at the end. It runs after the next renewal, or now with 'deploy run'.

Option Description
--site Required. An IIS site using the certificate.
--grant-key-access Give this account read access to the private key, such as 'IIS AppPool\Shop'.
--restart-service Restart this Windows service, by its service name, and wait for it to run.
--script Run this PowerShell script. SSLense runs its own copy, checked by hash.
--timeout For --script: seconds it may run (default 300).
--export-pfx Write the certificate, its intermediates, and its key to this PFX file. The password is asked for. Needs an exportable key.
--export-pem Write cert.pem, chain.pem, fullchain.pem, and key.pem to this folder; key.pem only for Administrators and SYSTEM. Needs an exportable key.
--central-store Write one PFX per name to this IIS Central Certificate Store folder. The store's password is asked for. Needs an exportable key.
--ftp-site Use the certificate for FTP over TLS on this IIS FTP site, set again after every renewal.
--http-sys Bind the certificate in HTTP.sys to this endpoint outside IIS after every renewal, such as 0.0.0.0:5986 for WinRM or api.example.com:8443.
--remote-desktop Make Remote Desktop on this server use the certificate after every renewal; NETWORK SERVICE is given its key.
--sql-server Make this SQL Server instance (MSSQLSERVER for the default) encrypt with the certificate after every renewal; its account is given the key, and it is restarted.
--web-server apache, nginx or tomcat on Windows: write its certificate files to --folder after every renewal, then restart --service. Needs an exportable key; Tomcat's keystore password is asked for.
--folder With --web-server: the folder its configuration reads the certificate from.
--service With --web-server: the Windows service that runs it, such as Apache2.4, nginx or Tomcat10.

List the deployment steps and how they last ran.

Option Description
--site An IIS site using the certificate (default: every certificate with steps).

Run every step now, for the certificate in use.

Option Description
--site Required. An IIS site using the certificate.

Remove a step. Access already granted and services already restarted are not changed.

Option Description
--site Required. An IIS site using the certificate.
--step Required. The step's number, as 'deploy list' shows it.

Renew managed certificates that are due according to ARI or the fallback schedule.

Option Description
--all Renew all managed certificates that are due.
--site Renew the managed certificate for one IIS site.
--force Renew selected certificates even when they are not due.

Show managed certificates, environments, and renewal status.

Verify that only Administrators and SYSTEM can access the SSLense data directory.

Restrict the SSLense data directory to Administrators and SYSTEM. Run by the installer.

Check the service, permissions, IIS, certificates, DNS, port 80, and each certificate authority in use.

Create a redacted diagnostic bundle to attach to a GitHub issue.

Option Description
--output Zip file to create (default: sslense-diagnostics-<timestamp>.zip on your Desktop).
--redact-hosts Replace site names, host names, and site folders with placeholders, for posting the bundle publicly.

Run IIS, HTTP, and DNS readiness checks.

Option Description
--site Required. IIS site name.
--hosts Required. Comma-separated host names.
--validation Which validation to check: http (the default), http-self (SSLense answering on port 80), dns, or dns-manual. DNS checks change nothing in DNS.
--names Comma-separated names for the certificate to cover, such as "*.example.com,example.com". Needs DNS validation.
--ca For DNS validation: the certificate authority whose CAA identities to check. Let's Encrypt when left out.

Show certificate details, bindings, and recent logs.

Option Description
--site Required. Managed IIS site name.

Check now that IIS serves the expected certificate on each of its host names. Changes nothing.

Option Description
--site Required. Managed certificate name: its IIS site, or site/host for a further certificate on a site.

Remove a managed certificate and its matching IIS HTTPS bindings.

Option Description
--site Required. Managed IIS site name.
--yes Confirm removal of matching HTTPS bindings and the managed certificate.

Stop managing a certificate and leave IIS as it is: its HTTPS bindings and the certificate stay, and SSLense no longer renews it.

Option Description
--site Required. Managed certificate name: its IIS site, or site/host for a further certificate on a site.

Save general defaults and renewal settings.

Option Description
--email Default ACME account email.
--renewal-days Required. Fallback schedule when the CA offers no renewal window (ARI), 1-89 days, capped at a third of the lifetime. Reminders are set with 'reminders set'.

Install and start the automatic renewal service.

Option Description
--service-path Path to the published SSLense.Service.exe. Defaults to the CLI directory.

Stop and remove the automatic renewal service.

Show the automatic renewal service status.

Start the automatic renewal service.

Stop the automatic renewal service.

Configure where SSLense sends alerts: email, Teams, Slack, Discord, Telegram, ntfy, a heartbeat, and the Windows Event Log.

List the configured notification channels.

Send alerts by email through any SMTP server or relay.

Option Description
--preset Start from a common setup: m365-relay, m365, gmail, sendgrid, exchange, custom.
--host SMTP server or relay host name.
--port SMTP port (25, 587, or 465).
--security auto (default), starttls, ssl (TLS on connect, port 465), or none.
--auth none (relay by IP address) or password. The password is prompted.
--user SMTP username, with --auth password.
--from Required. Sender address.
--to Required. Recipient addresses, comma-separated.

Add a chat or push channel. The webhook URL is prompted without echo.

Option Description
--type Required. teams, slack, discord, telegram, ntfy, or generic.
--name Optional label, to tell several channels apart.
--sign With --type generic: sign each payload with HMAC-SHA256. A new shared secret is shown once, for the receiver.

Ping a monitoring URL (healthchecks.io, Uptime Kuma, and similar) after every healthy hourly check. The URL is prompted.

Option Description
--remove Stop pinging the heartbeat URL.

Turn the Event Log and success notifications on or off.

Option Description
--event-log on or off: write alerts to the Windows Application event log.
--notify-success on or off: also send successful renewals to email and chat.

Remove the email settings or one chat channel.

Option Description
--email Remove the email settings.
--chat Remove chat channel N, as numbered by 'notifications show'.

Send a test through every channel and report each result.

Remove every notification channel. The Event Log stays on.

Daily reminder digest for certificates close to expiry: settings, per-certificate snooze or off, and a preview.

Show the reminder settings and each certificate's reminder state.

Change the reminder settings; options left out keep their value.

Option Description
--start-days Start reminding this many days before expiry (1-365).
--repeat-days Days between reminders for a certificate (1-30); daily in the last 7 days.
--send-at Hour of the day (0-23, server time) from which the digest is sent.
--notices One notice when an automatic certificate is about to renew: on or off.
--repeat-automatic Keep reminding about automatic certificates until they renew: on or off.
--weekly Weekly summary: off, or a day such as monday.
--checks Daily renewal readiness and served-certificate checks: on or off.

Turn reminders on, snooze them, or turn them off for one certificate.

Option Description
--site Required. Managed IIS site.
--mode Required. on, snooze, off-until-replaced (until a new certificate is installed), or off (permanently).
--days With snooze: days until reminders resume (default 7).

Print today's digest as it would be sent now, without sending or recording anything.

Send today's digest, marked as a sample, through every channel. Nothing is recorded.

Maintenance window: when automatic renewals may run. A renewal close to expiry never waits for it, and 'renew' always runs at once.

Show the maintenance window.

Let automatic renewals run only in this window.

Option Description
--days Required. Days the window starts on: mon,tue,... or weekdays, weekend, every-day.
--from Required. Hour it opens, 0-23, server time.
--to Required. Hour it closes, 0-23; earlier than --from means the next day, as --from 22 --to 4.

Let automatic renewals run whenever they are due.

Revoke a certificate at its certificate authority. By default a new certificate with a new key is installed first, so no site serves a revoked certificate.

Option Description
--site The certificate SSLense manages, by its name.
--file A certificate file (PEM or DER) this server's account issued, such as one SSLense saved after a failed revocation.
--ca With --file: the certificate authority that issued it.
--reason key-compromise (default), superseded, cessation, or unspecified.
--no-replace Revoke without installing a replacement first. Its sites keep serving the revoked certificate, which browsers refuse.
--yes Confirm: revocation cannot be undone.

This server's ACME accounts.

Replace the account key, for example if it may have been copied. Certificates are not affected.

Option Description
--ca Required. The certificate authority, such as letsencrypt-staging.
--yes Confirm: the old key stops working at once.

Certificates in LocalMachine\My that nothing uses and that are expired, test leftovers or replaced.

List the candidates. Nothing is removed.

Remove the chosen candidates. Each is checked again first.

Option Description
--thumbprint Required. Comma-separated thumbprints from 'cleanup list'.
--yes Confirm: removed certificates cannot be restored unless you have a copy.

Show what happened to a certificate, newest first, and whether it can roll back.

Option Description
--site Required. The certificate SSLense manages, by its name.

Bind the certificate the last renewal replaced again, while it is still valid. The current certificate is kept, so running it again goes forward.

Option Description
--site Required. The certificate SSLense manages, by its name.

Export this server's settings to a file, or import them from one.

Write the settings to a file. Secrets are left out unless --include-secrets is given.

Option Description
--file Required. The settings file.
--include-secrets Also export the secrets (DNS tokens, notification passwords and URLs, EAB keys), encrypted with the password in the SSLENSE_CONFIG_PASSWORD environment variable.
--certificates Also write the certificates to this CSV file, for 'bulk issue --file' on the other server.

Replace this server's settings with the file's. A file with secrets needs its password in SSLENSE_CONFIG_PASSWORD.

Option Description
--file Required. A file written by 'config export'.
--yes Confirm: the settings here are replaced; a copy of them is kept in the data folder.

Many certificates at once: watch every unmanaged one, or issue for the sites in a CSV file. One failure stops nothing else.

Watch every certificate bound in IIS that SSLense does not manage yet. Nothing in IIS changes.

Issue a certificate for each row of a CSV file, one after another.

Option Description
--file Required. The CSV file: site, hosts, validation (http, http-self or dns), names, email, ca, profile, key. A header row may name them.
--dry-run Run each row's pre-issue checks only; nothing is ordered.
--accept-production-risk Confirm rows for a certificate authority whose certificates are trusted, such as letsencrypt.

Show this SSLense version, and whether a newer release is published. Nothing is downloaded or installed.

Watch a certificate served by another machine, such as a load balancer: SSLense reads it every day and reminds you before it expires. It changes nothing there.

Option Description
--name Required. How SSLense lists it, such as 'Load balancer'.
--host Required. The host name or address that serves it.
--port The port, 443 by default.

Redirect HTTP to HTTPS on a certificate's IIS site with an IIS URL Rewrite rule that never redirects validation requests.

Show whether the site redirects.

Option Description
--site Required. The certificate, or its IIS site.

Add the redirect, and remove it again if it would block validation.

Option Description
--site Required. The certificate, or its IIS site.

Remove SSLense's redirect rule.

Option Description
--site Required. The certificate, or its IIS site.

List IIS HTTPS bindings and their certificates, and whether SSLense manages them.

Start monitoring the certificate already bound to a site, without changing IIS.

Option Description
--site Required. IIS site name.
--thumbprint Certificate to adopt, when the site uses several.

Create a certificate request (CSR) to buy or renew a certificate elsewhere. The private key stays on this server.

Option Description
--site Required. IIS site the certificate is for.
--hosts Required. Comma-separated host names; the first becomes the common name.
--key rsa2048 (default), rsa3072, or ec256.
--out File for the request (default: on your Desktop).

List certificate requests waiting for a certificate, or show one again.

Option Description
--site Show the request for this site again.

Remove a pending certificate request and delete its private key.

Option Description
--site Required. IIS site name.

Install the certificate issued for a site's pending request, and bind it safely.

Option Description
--site Required. IIS site with the pending request.
--certificate Required. Certificate file from the provider (.crt, .cer, or .pem).
--chain Intermediate bundle from the provider (often ca-bundle or chain).
--force Replace a certificate that SSLense renews automatically.

Install a certificate from a PFX file and bind it safely. The password is prompted.

Option Description
--site Required. IIS site to bind the certificate to.
--pfx Required. PFX (.pfx or .p12) file with the certificate and its private key.
--hosts Host names to bind (default: the site's host names the certificate covers).
--force Replace a certificate that SSLense renews automatically.