Ensure the signed certificate files is on or accessible by the system that created the original certificate request
Sign in to the computer where the certificate was originally requested then start an administrative PowerShell session
Run the following commands to define the certificate to be imported:
$Path = Read-Host -Prompt "Provide the path to the certificate file" $Name = Read-Host -Prompt "Provide the name of the certificate file" |
Run the following commands to retrieve the certificate to be imported:
$CertificateFilePath = Get-ChildItem -Path $Path | Where-Object { $_.Name -Match $Name } | Sort-Object -Property LastWriteTime | Select-Object -Last 1 -ExpandProperty FullName |
Run the following commands to verify the certificate to be imported:
$CertificateFromFile = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($CertificateFilePath) $CertificateFromFile | Select-Object -Properties Thumbprint, HasPrivateKey, NotBefore, NotAfter, Subject, Issuer |
Run the following commands to define the certificate store:
$CertStoreLocation = 'Cert:\LocalMachine\My' |
Run the following commands to import the certificate:
$CertificateObject = Import-Certificate -FilePath $CertificateFilePath -CertStoreLocation $CertStoreLocation $CertificateObject | Select-Object -Properties Thumbprint, HasPrivateKey, NotBefore, NotAfter, Subject, Issuer |