The ExportPFXaction is used to export a certificate from the local computer. For example, if you want to use the same certificate on multiple computers, you can export the certificate from the local computer in order to import it on another computer. The ExportPFXaction requires the following syntax.

Copy Code
LCSCmd.exe /Cert /Action:ExportPFX /Filename:<file name>
/Password:<password>  /issuer:<common name of the issuer
of the certificate> [/subjectName:<subject name of the
certificate>] [/serialNumber:<serial number of the
certificate>] [/includeChain[:{TRUE|FALSE}]] [/L:<log file
path>] [/XML[:{TRUE|FALSE}]] [/?[:{TRUE|FALSE}]]

Such as:

Copy Code
LcsCmd.exe /Cert /Action:ExportPFX
/Filename:C:\ExportedCertificate.pfx /Password:CertPAssw0rd
/issuer:contoso-CA /subjectName:Pool01-Certificate


Parameter Description


Executes the selected certificate task on the current computer.


Takes a string that specifies the action name. Valid action names include Request, CheckStatus, ImportResponse, ImportPFX, ExportPFX, ListCA, and ImportCAChain.


Specifies the PFX file to which you want to export the certificate and its private key.


Specifies the PFX file password.


Specifies the common name of the certificate issuer.


Specifies the subject name of the certificate.


Specifies the certificate serial number.


Specifies whether to include the certificate chain.


Specifies the log file path. If not specified, %TEMP%\<ActionName>[<Date>][<Time>].html is used. To disable logging, use a dash character (-) as the log file name.


Specifies whether the log file to be generated should be in XML format instead of HTML.


Shows Help on usage.

You must specify either a subject name or a serial number for the command to complete successfully. Also, you will not be able to export a certificate unless the certificate was specified as exportable when it was created. If you use the Requestaction to create a certificate, you can specify a certificate as exportable by setting the /exportableparameter to True.