Determine if a certificate is installed using CN (via powershell 2.0)?
certificate, powershell
Solution
something like this can work for you?
[bool](dir cert:\LocalMachine\My\ | ? { $_.subject -like "cn=localho*" })
Problem
I have a PS 2.0 script that needs to check if a few certificates are installed. I tried this but it didn't work... ``` if(Test-Path cert:\LocalMachine\My\mycert1.mydomain.com) {Write-Host "cert is installed"} ``` I can do a test-path for the thumbprint, but I want to check if it is installed by the common name...? Any ideas? Thanks!