Export certificates in IE with script. RRS feed

  • Question

  • Hi everyone,

    I want to run a script wich exports all my personal certificates from internet explorer to a location on my pc.

    Is this posibble and do you guys already have a script for it?

    Thanks for replying this Question!


    Friday, November 18, 2016 10:04 AM

All replies

  • Your personal certificates in Internet Explorer aren't actually stored in IE, but it's a presentation of your 'Current User' certificate store (compare with certmgr.msc, navigating to personal\certificates).

    It's certainly possible. I don't have a ready script on the shelf, but the basic explanation of what the basic code (in Powershell) would look like is simple enough.

    First you create a collection of certificates:

    $Certificates = Get-ChildItem Cert:\CurrentUser\My

    Next, you parse the collection and export the certificates with either Export-Certificate or Export-PfxCertificate, depending on whether you also need the private key in your export.

    ForEach($Certificate in $Certificates){


        Export-Certificate -Cert <Certificate> -FilePath <String> [-Force] [-NoClobber] [-Type <CertType> {SST | CERT | P7B} ] [-Confirm] [-WhatIf] [ <CommonParameters>]


    Export-PfxCertificate [-PFXData] <PfxData> [-FilePath] <String> [-ChainOption <ExportChainOption> {BuildChain | EndEntityCertOnly | PfxDataOnly} ] [-Force] [-NoClobber] [-NoProperties] [-Password <SecureString> ] [-ProtectTo <String[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

    Check https://technet.microsoft.com/en-us/library/hh848628.aspx and https://technet.microsoft.com/en-us/library/hh848635.aspx which cmdlet and parameters suit your needs best.



    Friday, November 18, 2016 2:48 PM
  • Thank you for your answer!

    I am going to have a look at it and try it out soon.

    I will reply when i have it working.

    Friday, November 18, 2016 3:23 PM