The knowledge base / All cheat sheets
● Always in your toolkitAbout the project ↗

Windows certificate store inspection cheat sheet

Inspect certificate stores, expiration dates and thumbprints when investigating a Windows service certificate.

PowerShell Certificate provider on Windows. Store contents and private-key permissions depend on the account and host.

Updated · Windows · 6 min read

CommandWhat it does
Get-ChildItem Cert:\LocalMachineList machine certificate stores
Get-ChildItem Cert:\LocalMachine\MyList machine personal certificates
Get-ChildItem Cert:\LocalMachine\My | Select-Object Subject,Thumbprint,NotAfter,HasPrivateKeyInspect certificate identity and expiry
Get-ChildItem Cert:\LocalMachine\My -ExpiringInDays 30Find certificates nearing expiration
Get-Item Cert:\LocalMachine\My\0123456789ABCDEF0123456789ABCDEF01234567 | Format-List *Inspect one certificate by thumbprint

Walkthrough

Run on the service host using authorized read access. Replace the example thumbprint with the actual public certificate identifier. These commands inspect certificates and do not export private keys or change bindings.

Step 1: List machine certificate stores

Get-ChildItem Cert:\LocalMachine

Inspect available machine-level stores and choose the store used by the service. A user-level store is separate, and store presence does not prove that a service is configured to use it.

Step 2: List machine personal certificates

Get-ChildItem Cert:\LocalMachine\My

Review certificates in the local machine personal store. The list can include certificates for multiple services; match the thumbprint and hostname with the actual service configuration.

Step 3: Inspect certificate identity and expiry

Get-ChildItem Cert:\LocalMachine\My | Select-Object Subject,Thumbprint,NotAfter,HasPrivateKey

Compare subject, thumbprint, expiration and private-key presence with the intended certificate. HasPrivateKey does not establish that the service account has permission to use the key.

Step 4: Find certificates nearing expiration

Get-ChildItem Cert:\LocalMachine\My -ExpiringInDays 30

Review the returned certificates in context; an expiring certificate may be unused or already replaced. Confirm the service binding and complete chain before scheduling renewal work.

Step 5: Inspect one certificate by thumbprint

Get-Item Cert:\LocalMachine\My\0123456789ABCDEF0123456789ABCDEF01234567 | Format-List *

Replace the example thumbprint with the certificate identifier and protect the output, which can reveal internal names. This reads certificate metadata; it does not prove which certificate a remote client receives.

WORKED INCIDENT

Practical case: A service presents an expired certificate

Fictional teaching scenario; observations are examples, not captured production output.

Situation

A Windows-hosted service has a renewed certificate, but clients still report an expiry error.

Investigation sequence

1. List machine certificate stores

Get-ChildItem Cert:\LocalMachine

Identify the certificate store used by the affected service.

2. Inspect certificate identity and expiry

Get-ChildItem Cert:\LocalMachine\My | Select-Object Subject,Thumbprint,NotAfter,HasPrivateKey

Compare the old and renewed certificate thumbprints and expiration dates.

3. Find certificates nearing expiration

Get-ChildItem Cert:\LocalMachine\My -ExpiringInDays 30

Check the expiring certificates in the machine personal store.

4. Inspect one certificate by thumbprint

Get-Item Cert:\LocalMachine\My\0123456789ABCDEF0123456789ABCDEF01234567 | Format-List *

Inspect the specific public certificate metadata by its confirmed thumbprint.

Example findings

Illustrative findings: a valid renewed certificate is present, while the service configuration still references the older expired thumbprint.

Interpret the findings

The binding mismatch explains the reported certificate in this example. Certificate presence alone does not update a service binding or establish private-key access for the service account.

Verify the outcome

After the service owner updates the approved binding, verify the certificate presented to a client, its hostname, chain and expiration using the normal application path.

Escalation handoff

Provide the service name, old and new public thumbprints and expiration dates to the certificate owner; never share private-key material.

Primary references

Documented reference; examples above are teaching scenarios. Confirm behavior against your deployed version.