Browse Windows certificate stores with PowerShell (Cert: drive)

Treat the Windows certificate store like a filesystem: list certificates, sort by expiry, and find the ones about to lapse.

WindowscertificatessecuritypowershellLow risk
Run `Get-ChildItem Cert:\LocalMachine\My | Select-Object Subject, NotAfter` to list machine certificates with their expiry dates.

01Command

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

02What it does

PowerShell exposes certificate stores as a drive: Cert:\CurrentUser\My, Cert:\LocalMachine\Root, and friends behave like folders, so the usual Get-ChildItem / Where-Object pipeline works. The killer use is expiry monitoring: `... | Where-Object NotAfter -lt (Get-Date).AddDays(30)` finds certificates that will expire within a month. Each object also carries Thumbprint, which you need for renewal or removal commands.

03Risk

RiskLow risk
RequirementsReading LocalMachine stores may require elevation; CurrentUser\My works without it.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Get-PfxCertificate | Microsoft Learn
    Microsoft · vendor-doc · 2026-09-17
    Evidence: Microsoft documents the Certificate provider and Cert: drive, letting PowerShell navigate certificate stores and read certificate objects such as NotAfter.
  • Get-ChildItem | Microsoft Learn
    Microsoft · vendor-doc · 2026-09-17
    Evidence: Microsoft documents Get-ChildItem as the cmdlet for enumerating items at any provider path, including the Cert: certificate store drive.

Last verified: 2026-09-17 · Category: Security & Privacy

06Related solutions