Last active
January 10, 2022 08:47
-
-
Save norman-bauer/323d5573d8156a61a45d9d7a3a30f07e to your computer and use it in GitHub Desktop.
PowerShell script to unarchive a previously archived certificate in the local machine my store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$store = New-Object System.Security.Cryptography.X509Certificates.X509Store "My","LocalMachine" | |
$store.Open(9) #ReadWrite + IncludeArchived | |
$store.Certificates |? Archived -eq $true | |
$store.Certificates |? Archived -eq $true |% {$_.Archived = $false} #Unarchive all certificates | |
$store.Certificates |? Subject -eq "CN=archivedcert" |% {$_.Archived = $false} #Unarchive certificates with given subject | |
$store.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment