Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Sign in to the computer where the certificate was originally requested then start an administrative PowerShell session

    Info

    Complete any remaining instructions in this PowerShell session unless directed otherwise


  2. Run the following commands to define the certificate to be imported: 

    Code Block
    $path_cer = Read-Host -Prompt "Provide the path to the certificate file"
    $name_cer = Read-Host -Prompt "Provide the name of the certificate file"


  3. Run the following commands toverify the certificate to be imported: 

    Code Block
    $file_cer = Get-ChildItem -Path $path_cer | Where-Object { $_.Name -Match $name_cer } | Sort-Object -Property LastWriteTime | Select-Object -Last 1
    $test_cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($file_cer.FullName)
    $test_cer | Select-Object Thumbprint, HasPrivateKey, NotBefore, NotAfter, Subject, Issuer


  4. Run the following commands to import the certificate: 

    Info

    The Import-Certificate command will import certificates into the certificate store of the current user. The certificate store of the computer is specified by using the "CertStoreLocation" parameter with the Cert:\LocalMachine\My value. 


    Code Block
    $cert_folder = 'Cert:\LocalMachine\My'
    $cert_object = Import-Certificate -FilePath $file_cer.FullName -CertStoreLocation $cert_folder
    $cert_object | Select-Object Thumbprint, HasPrivateKey, NotBefore, NotAfter, Subject, Issuer


...