Searching and Installing CertificatesΒΆ
Get all installed certsΒΆ
Find cert by thumbprintΒΆ
PowerShell
dir Cert:\CurrentUser\My | Where-Object { $_.Thumbprint -in "THUMBPRINT1", "THUMBPRINT1" }
Tip
Text Only
Different locations:
* CurrentUser
* LocalMachine
Different folders:
* My
* addressbook
* TrustedPeople
* Local NonRemovable Certificates
* REQUEST
* AuthRoot
So sometime it's better to look for all cert to find if there is any as search will look for particular location
Search by Friendly NameΒΆ
Search by Thumbprint anywhereΒΆ
Search By NotAfter (expiry date)ΒΆ
This will list any certificates that isn't valid after the 31 Dec 2020
This will list any certificates that will expire the upcomming year, from now and one year ahead
PowerShell
dir cert: -Recurse | Where-Object { $_.NotAfter -gt (Get-Date) -and $_.NotAfter -lt (Get-Date).AddYears(1) }
Uninstall cert by thumbprintΒΆ
Uninstall by subject/serial number/issuer/whateverΒΆ
PowerShell
Get-ChildItem Cert:\LocalMachine\My |
Where-Object { $_.Subject -match 'foo' } |
Remove-Item