How to migrate a certificate for email encryption in Outlook if the private key is not available?

OZ 226 Reputation points
2025-02-27T18:29:36.6066667+00:00

We have users with certificates for encrypting mail in Outlook. The certificate was obtained from an internal certification authority, which is still working. It became necessary to migrate the user to another machine along with the certificate for mail. But it turned out to be impossible to export the certificate together with the private key. Is there a way to transfer the certificate to another machine so that it would be possible to decrypt mail? Or somehow get the private key?

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,808 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyi Chang (Shanghai Wicresoft Co Ltd) 410 Reputation points Microsoft Vendor
    2025-02-28T02:30:29.34+00:00

    Hi,

    Welcome to the Microsoft Q&A platform!

    You can try the following two ways:

    1. Copy the source key file to a new computer:

    Run if you don't know the SID of the user:

    $cert = Get-ChildItem Cert:\CurrentUser\My | Where {$_.Subject -match “user name”}
    $keyContainer = $cert.PrivateKey.CspKeyContainerInfo.UniqueKeyContainerName
    

    Copy the key file:

    $sourcePath = “C:\ProgramData\Microsoft\Crypto\RSA\User SID\$keyContainer”
    Copy-Item $sourcePath -Destination “\\\ New Computer\C$\Temp\” -Force
    

    User's image

    User's image
    Import on new computer

    $destPath = “C:\ProgramData\Microsoft\Crypto\RSA\User SID\”
    robocopy “C:\Temp” $destPath $keyContainer /SEC
    
    1. The administrator reissues the exportable certificate through the CA. Copy the existing template in the CA console, check “Allow private key export” in the “Request Processing” tab, and issue a new version of the template.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.