PFX Export (Windows)
Export an SSL certificate to a PFX/PKCS12 backup file from Windows Server using certlm.msc, MMC, or PowerShell.
When should you export?
Export your certificate to a PFX file (PKCS#12) when you need to:
- Create a backup of the certificate and the private key
- Move the certificate to another server
- Import the certificate into another application (IIS, Exchange, ADFS, etc.)
Prerequisites
- Administrator access to the server
- The certificate must be installed with an exportable private key
Export via certlm.msc (Recommended)
- Press Windows + R, type
certlm.mscand press Enter. - Navigate to Personal → Certificates.
- Right-click the certificate you want to export → All Tasks → Export...
- Select Yes, export the private key and click Next.
- Choose Personal Information Exchange (.PFX). Tick Include all certificates in the certification path to include intermediate certificates.
- Specify a strong password to protect the PFX file.
- Choose a filename and location, and click Finish.
Export via MMC (Older Windows versions)
- Press Windows + R, type
mmc.exeand press Enter. - Go to File → Add/Remove Snap-in.
- Select Certificates, click Add, select Computer account → Local computer.
- Click OK.
- Navigate to Certificates (Local Computer) → Personal → Certificates.
- Right-click → All Tasks → Export... and follow the wizard as described above.
Export via PowerShell
$cert = Get-ChildItem -Path Cert:\LocalMachine\My | Where-Object { $_.Subject -like "*your-domain.dk*" }
$password = ConvertTo-SecureString -String "DitNyePassword" -AsPlainText -Force
Export-PfxCertificate -Cert $cert -FilePath "C:\backup.pfx" -Password $password
Troubleshooting
- "The export failed - the key is not exportable": The certificate was imported without enabling "Mark this key as exportable". You must re-import the PFX file with this setting enabled.
- "Yes, export the private key" is greyed out: Same reason – the private key was not marked as exportable during the initial import.
Security
- Always use a strong password for PFX files (at least 16 characters).
- Delete PFX files from temporary locations after use.
- Store backup PFX files securely (encrypted USB, password manager, or vault).
Strengthen your TLS security
Use IIS Crypto to easily configure secure TLS protocols and cipher suites on your Windows Server.
IIS Crypto TLS configuration guide