Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matejskubic/db4199660e75e067e82f7cf94d3ebb67 to your computer and use it in GitHub Desktop.
Save matejskubic/db4199660e75e067e82f7cf94d3ebb67 to your computer and use it in GitHub Desktop.
D365FO - renew certificate with Let's Encrypt
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="." mimeType="text/plain" />
</staticContent>
</system.webServer>
</configuration>
#Install-Module -Name Posh-ACME -Scope AllUsers
$contact = 'email@domain.com'
$domain = '...devaos.cloudax.dynamics.com'
$certNames = @('...devaossoap.cloudax.dynamics.com')
Set-PAAccount -Contact $contact
$response = New-PACertificate -Domain $domain -DnsAlias $certNames -Plugin WebRoot -PluginArgs @{WRPath='C:\inetpub\wwwroot'; Verbose=$true} -AcceptTOS -Verbose
Install-PACertificate -PACertificate $response -StoreLocation LocalMachine -StoreName My
$site = Get-WebBinding -HostHeader $domain
$site.RebindSslCertificate($response.Thumbprint, $site.certificateStoreName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment