Delete all certificates in My store by Issuer
Hi Guys, Is it possible using certutil or (other commandline operator) to delete all certificate in the "My" store from a specified issuer? I can easily delete by name or serial number but by issuer is seeming a little more difficult. Thanks
June 11th, 2009 5:10am

Hi, As far as I know, we can use PowerShell to delete certificate by Issuer. Try the following command: get-item cert:\CurrentUser\My\* | foreach{if($_.issuer -eq "ISSUER_NAME") remove-item $_} For more information, please refer to the following article. Certificate Provider http://technet.microsoft.com/en-us/library/dd347615.aspx Thanks. This posting is provided "AS IS" with no warranties, and confers no rights.
Free Windows Admin Tool Kit Click here and download it now
June 12th, 2009 10:11am

As a reminder, I'd like to state that making alterations in the registry are dangerous by nature and not supported by m$. Information is the most valuable commodity I know off.
June 13th, 2009 10:04pm

Sorry for the delay in getting this post in, its been a while since I could address this topic. Thanks for the assistance Mervyn, however does this process remove the certs from the Computer\Personal store? Or does this remove from the User\Personal store? Im looking at removing from the computer store if that makes a difference. Thanks again
Free Windows Admin Tool Kit Click here and download it now
June 23rd, 2009 3:04am

Acutally, just figured it out... Simply Replace CurrentUser with LocalMachine and there she be. Thanks again.
June 23rd, 2009 3:06am

The certificate provider does not support Remove-Item - it's effectively a ReadOnly view. I used the following to delete certificates which uses a combination of what is listed here and on the following article: http://www.leeholmes.com/blog/2007/08/23/removing-certificates-from-the-certificate-store/ $storeNames = "My", "TrustedPeople" $storeLocation = "LocalMachine" "CN=Cert1", "CN=Cert2" | %{ $certCommonName = $_ $storeNames | %{ $storeName = $_ $location = "cert:\" + $storeLocation + "\" + $storeName Get-ChildItem $location | ?{ $_.Subject -eq "$certCommonName"} | %{ $cert = $_ $store = New-Object System.Security.Cryptography.X509Certificates.X509Store $storeName, $storeLocation $store.Open(ReadWrite) $store.Remove($cert) $store.Close() } } }
Free Windows Admin Tool Kit Click here and download it now
August 10th, 2011 2:29pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics