List installed personal certificates in batch

I use a few secure websites that require me to install a PFX certificate to access them. I have multiple computers I do this from, and I need a quick way of determining which ones in which I still need to install the certificate.

Is there a way I can list all the certificates in the Personal store using batch commands? I can run the command remotely, but I'm not aware of any method to list them.

"How can I get a list of installed certificates on Windows?" is a similar question but I'm looking for a solution specific to command line. The answers there all involve using the GUI or Powershell.

enter image description here


Solution 1:

Here's how to do it from a cmd.exe shell on Windows 7, without first starting PowerShell:

C:\> powershell -Command Get-ChildItem -Recurse Cert:

You can then pipe the output to other commands (which commands? well, your question isn't about that, so I won't go into detail) or to a file. From there you can isolate whether the specific cert you're looking for is installed.

Since you said you're on Windows 7, I assume that PowerShell is installed. To not have PowerShell, it would explicitly have to be uninstalled, and you didn't mention in your question that PowerShell was uninstalled or not available, or that the solution has to work on pre-Vista Windows where PowerShell didn't exist.

Solution 2:

No Powershell necessary.

Also the proposed solution dumps raw data not just the Personal store requested by the OP.

N.B. The following was run in an Administrator command prompt shell

C:\windows\system32>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"

OS Name:                   Microsoft Windows 7 Enterprise

OS Version:                6.1.7601 Service Pack 1 Build 7601

C:\windows\system32>certutil -store My

My   <<< Certificate Store Name

================ Certificate 0 ================

Serial Number: ****************************  *<<< asterisks = mask for post. You will see cert info*

Issuer: ****************************

NotBefore: ****************************

NotAfter: ****************************

Subject: CN=****************************

Non-root Certificate

Template: ****************************

Cert Hash(sha1): ****************************

Simple container name: ****************************

  Provider = Microsoft RSA SChannel Cryptographic Provider

Private key is NOT exportable

Encryption test passed