cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using PowerShell to Detect Certificate.

Using PowerShell to Detect Certificate.

Summary

Using PowerShell to Detect Certificate.

Synopsis

These PowerShell commands can be used if you are looking to detect what certificates are installed on a system:
set-executionpolicy unrestricted
set-location cert:\localmachine\ca
get-childitem

The above command should show a list of Certificates installed on the system.
  • The adjustment made in the command below should only return objects with "root" in the subject.
get-childitem | where-object { $_.subject -like "*root*"}
  • The adjustment in the command below will return you a list of friendlynames for certs.
get-childitem | format-table friendlyname
  • ?The adjustment made in the command below should only return objects with 256 in the friendlyname. This can be used to detect certificates that are sha256.
get-childitem | where-object { $_.friendlyname -like "*256*"} | format-table friendlyname
  • Sometimes friendlyname is not populated. Instead of friendlyname you can try IssuerName or SubjectName.
(e.g:) get-childitem | format-table IssuerName

PowerShell commands can be run from a Custom Action in a Basic MSI project. See Additional Information for steps and more information.

Additional Information

Calling a PowerShell Custom Action
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Jul 09, 2018 10:17 PM
Updated by: