Due to a migration project from Groupwise to Exchange (Exchange 2010 SP1) I'm using temporarily a self signed certificate for Exchange. I want this certificate to deploy via GPO and am running into the following problem. I'm using the following code to export the certificate to a file:
$file = Export-ExchangeCertificate -Thumbprint 89F6B890FD76EFAFC1E359001AFDD51D99F8BFC8 -Password (Get-Credential).password
Set-Content -Path "c:\certificates\htcert.pfx" -Value $file.filedata -Encoding byte
But when running this command I'm getting the following error message:
The private key couldn't be exported as PKCS-12. It either couldn't be accessed or isn't exportable.
+ CategoryInfo : InvalidArgument: ) [Export-ExchangeCertificate], InvalidOperationException
+ FullyQualifiedErrorId : 77B0CDDB,Microsoft.Exchange.Management.SystemConfigurationTasks.ExportExchangeCertificate
How can I fix this?