Export-PfxCertificate
Export-PfxCertificate [-Cert*] <Certificate> [-FilePath*] <String> [-ChainOption {BuildChain | EndEntityCertOnly |PfxDataOnly}] [-Force] [-NoClobber] [-NoProperties] [-Password <SecureString>] [-ProtectTo <String[]>] [-Confirm][-WhatIf] [<CommonParameters>]
Export-PfxCertificate [-PFXData*] <PfxData> [-FilePath*] <String> [-ChainOption {BuildChain | EndEntityCertOnly |PfxDataOnly}] [-Force] [-NoClobber] [-NoProperties] [-Password <SecureString>] [-ProtectTo <String[]>] [-Confirm][-WhatIf] [<CommonParameters>]
The Export-PfxCertificate cmdlet exports a certificate or a PFXData object to a Personal Information Exchange (PFX) file. By default, extended properties and the entire chain are exported.
Delegation may be required when using this cmdlet with Windows PowerShellr remoting and changing user configuration.
Parameters
-Cert <Certificate>
- This value is required
- Accepts pipeline input ByPropertyName
Specifies the path to the certificate to be exported.
-ChainOption [<ExportChainOption>]
Specifies the options for building a chain when exporting certificates. The acceptable values for this parameter are:
-- BuildChain: Certificate chain for all end entity certificates will be built and included in the export. This option is valid for both PfxData and Cert parameters. In the case of PfxData parameter, the collection of all PFX certificates will be used as an additional store.
-- EndEntityCertOnly: Only end entity certificates are exported without any chain. This option is valid for both the PfxData and the Cert parameters.
-- PfxDataOnly: Certificates contained in PFXData objects will be exported with no chain building. This option is only valid when the PfxData parameter is used.
-FilePath <String>
- This value is required
Specifies the path for the PFX file to be exported.
-Force [<SwitchParameter>]
Specifies that the provided PFX file should be overwritten, even if the Read-only attribute is set on the file. By default, this cmdlet overwrites existing PFX files without warning, unless the Read-only or hidden attribute is set or the NoClobber parameter is used in the cmdlet.
-NoClobber [<SwitchParameter>]
Specifies that if the PFX file already exists, it should not be over written. This parameter takes precedence over the Force parameter, which permits this cmdlet to overwrite a PFX file even if it has the Read-only attribute set.
-NoProperties [<SwitchParameter>]
Specifies whether the extended properties for a certificate are exported. If this parameter is specified, then extended properties are not included with the export. By default, all extended properties are included in the exported file.
-PFXData <PfxData>
- This value is required
- Accepts pipeline input ByValue
Specifies a PFXData object that contains one or more certificates from a PFX file.
-Password [<SecureString>]
Specifies the password used to protect the exported PFX file. The password should be in the form of secure string. Either the ProtectTo or this parameter must be specified, or an error will be displayed.
-ProtectTo [<String[]>]
Specifies an array of strings for the username or group name that can access the private key of PFX file without any password. This requires a Windows Serverr 2012 domain controller. Either the Password or this parameter must be specified, or an error will be displayed.
-Confirm [<SwitchParameter>]
- Default value is false
Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.
-WhatIf [<SwitchParameter>]
- Default value is false
Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.
Inputs
System.Security.Cryptography.X509Certificates.X509Certificate2[]Outputs
System.IO.FileInfoThis work is licensed under a Creative Commons Attribution 4.0 International. It is attributed to Microsoft Corporation and can be found here.
PowerShell Commands