What password does domain-protected pfx require? What password does domain-protected pfx require? powershell powershell

What password does domain-protected pfx require?


Does this work for you?

& certutil -v -privatekey certificate.pfx | ? {$_ -match "^PFX protected password: ""(?<password>.*)""$"} | % { $matches.password }


This export PFX without password. When importing this through GUI, you can use empty password.

$cert = @(Get-ChildItem -Path 'Cert:\CurrentUser\My\07BAE0886EECC2019F0AE6CC68FE5C3EA98308F8')[0]$certBytes = $cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Pfx)[System.IO.File]::WriteAllBytes('S:\cert.pfx', $certBytes)