How to programmatically delete a certificate in trusted root certificate authorities?

I need to remove a specific certificate from every PC in my organization. Yes, I could sit on the seat, but I have until Thursday to take it off, and I have no manpower to sit on the seat.

Is there a software way to do this using C #?

+4
source share
2 answers

I do not think you need to unscrew any C # - look at certmgr.exe /del .

If you really want to write C # today to do this, take a look at X509Store.Remove .

+3
source

Here is an example on MSDN ( click here )

I think the example requires no explanation, but here is an excerpt:

 using System; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.IO; public class X509store2 { public static void Main (string[] args) { //Create new X509 store called teststore from the local certificate store. X509Store store = new X509Store ("ROOT", StoreLocation.CurrentUser); store.Open (OpenFlags.ReadWrite); ... store.Remove (certificate1); store.RemoveRange (collection); ... //Close the store. store.Close (); } } 
+2
source

All Articles