$store = New-Object System.Security.Cryptography.X509Certificates.X509Store "My","LocalMachine" $MaxAllowedIncludeArchive = ([System.Security.Cryptography.X509Certificates.openflags]::MaxAllowed –bor [System.Security.Cryptography.X509Certificates.openflags]::IncludeArchived) $store.Open($MaxAllowedIncludeArchive) [System.Security.Cryptography.X509Certificates.X509Certificate2Collection] $certificates = $store.certificates foreach ($cert in $certificates) { if ($cert.Archived) { Write-Host $cert.SubjectName.Name Write-Host " $($cert.Archived)" Write-Host " $($cert.NotAfter)" } } $store.Close()