PowerShell Logo Small

Import-PfxCertificate



This is the built-in help made by Microsoft for the command 'Import-PfxCertificate', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Imports certificates and private keys from a Personal Information Exchange (PFX) file to the destination store.

SYNTAX


Import-PfxCertificate [-FilePath] <String> [[-CertStoreLocation] <String>] [-Exportable] [-Password <SecureString>] [-Confirm] [-WhatIf] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Import-PfxCertificate cmdlet imports certificates and private keys from a PFX file to the destination store. Certificates with and without private keys in the PFX file
are imported, along with any external properties that are present.


Delegation may be required when using this cmdlet with Windows PowerShell® remoting and changing user configuration.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=287534
ConvertTo-SecureString
Get-ChildItem
Set-Location
Export-PfxCertificate

REMARKS

<

Examples


EXAMPLE 1

PS C:\>$mypwd = ConvertTo-SecureString -String "1234" -Force –AsPlainText



PS C:\>Import-PfxCertificate –FilePath C:\mypfx.pfx cert:\localMachine\my -Password $mypwd



This example imports the PFX file my.pfx with a private non-exportable key into the My store for the machine account.




EXAMPLE 2

PS C:\>Get-ChildItem -Path c:\mypfx\my.pfx | Import-PfxCertificate -CertStoreLocation Cert:\CurrentUser\My –Exportable



This example imports the PFX file my.pfx with a private non-exportable key into the My store for the current user with private key exportable. The Password parameter is not
required since this PFX file is not password protected.




EXAMPLE 3

PS C:\>Set-Location -Path cert:\localMachine\my



PS C:\>Import-PfxCertificate –FilePath c:\mypfx.pfx



This example imports the PFX file mypfx.pfx into the My store for the machine account. The Password parameter is not required since this PFX file is protected using the
domain account of this machine. This requires a Windows Server® 2012 domain controller.