Generate SQL Server self-signed certificate
Part of the requirement to deploy D365FO on-premises, is the SQL server certificate.
Recently, I worked on rotating the SQL server certificate for an environment.
I used the following as stated on Microsoft docs, I used :
# If Remoting, execute
#.\Configure-SQLCert-AllVMs.ps1 -ConfigurationFilePath .\ConfigTemplate.xml
.\Configure-SQLCert.ps1 -PfxCertificatePath “.\Certs\SQL1.contoso.com.pfx”
But then I got some errors (because I was not using the latest Infrastructure folder).
Another way of generating the SQL server certificate.
# Manually create certificate for each SQL Node (i.e. 2 nodes = 2 certificates)
# Run script on each node
$computerName = $env:COMPUTERNAME.ToLower()
$domain = $env:USERDNSDOMAIN.ToLower()
$listenerName = 'monsieurwinner'
$cert = New-SelfSignedCertificate -Subject "$computerName.$domain" -DnsName "$listenerName.$domain", $listenerName, $computerName -Provider 'Microsoft Enhanced RSA and AES Cryptographic Provider' -CertStoreLocation "cert:\LocalMachine\My" -KeyAlgorithm "RSA" -HashAlgorithm "sha256" -KeyLength 2048