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

Where:

Parameter Description

/Cert

Executes the selected certificate task on the current computer.

/Action

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

/Filename

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

/Password

Specifies the PFX file password.

/issuer

Specifies the common name of the certificate issuer.

/subjectName

Specifies the subject name of the certificate.

/serialNumber

Specifies the certificate serial number.

/includeChain

Specifies whether to include the certificate chain.

/L

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.

/XML

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.