I am trying to install Sitecore 9 on Windows Server 2012 R2.
There were some issues while executing Sitecore 9 installation script using SIF related to create self signed certificate for xConnect. Issues can be tracked in my previous question here.
Thus I decided to create this certificate using separate powershell script.
#install client certificate for xconnect
$Path = "c:\\certificates"
$XConnectCertName = "$prefix.xconnect_client"
$Signer = Invoke-GetCertificateConfigFunction -Id 'DO_NOT_TRUST_SitecoreRootCert' -CertStorePath Cert:\LocalMachine\Root -Verbose
$Signer.GetType()
$DnsName = "$prefix.xconnect_client"
$CertStoreLocation = 'Cert:\LocalMachine\My'
$signedCertificate = New-SelfSignedCertificate -CloneCert $Signer -DnsName $DnsName -CertStoreLocation $CertStoreLocation -Verbose
if ($null -eq $signedCertificate) {
throw "Failed to create signed certificate for '$DnsName' in $CertStoreLocation"
}
Write-Host "Created signed certificate $signedCertificate"
Write-Host "Export new certificate public key as a CRT file"
$exportFilePath = Join-Path -Path $Path -ChildPath "$XConnectCertName.crt"
$exportPFXFilePath = Join-Path -Path $Path -ChildPath "$XConnectCertName.pfx"
$pwd2 = ConvertTo-SecureString -String "123456" -Force -AsPlainText
Export-PfxCertificate -cert $signedCertificate -FilePath $exportPFXFilePath -Password $pwd2
$certificateInfo = Export-Certificate -Cert $signedCertificate -FilePath $exportFilePath -Force
Write-Information -MessageData "Exported signed certificate to $exportFilePath"
Import-PfxCertificate -FilePath $exportPFXFilePath -CertStoreLocation Cert:\LocalMachine\Root -Password $pwd2 -Exportable
After creating self signed certificate for xConnect, I executed the Sitecore installation script. There is much progress in the installation this time but at the end, I got another exception..
Install-SitecoreConfiguration : Unable to parse [ResolveCertificatePath(variable('Security.XConnect.CertificatePath'))] - Exception calling "InvokeWithContext" with "2" argument(s): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Certificate Cert:\Localmachine\My\5C6D03D9B5519EC698E50F58B4F9C8DF2E3729FA does not contain Private Key. Ensure that it has been exported with the Private Key."
I already gone through some resolutions mentioned here which is for Windows Server 2016, but this also didn't resolve the issue.
I also tried executing xconnect-createcert.json to create certificate mentioned in the answer.
Install-SitecoreConfiguration -Path C:\sitecore\install\xconnect-createcert.json
But it also doesn't resolve the issue and i am getting same exception at SetCertStorePermissions : FilePermissions
step.
Any help would be much appreciated.