Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

batch file to delete certificates

Posted on 2011-10-14
12
Medium Priority
?
381 Views
Last Modified: 2012-05-12
On one of our W2k8 terminal servers, a certain certificate keeps getting installed, and I have to go into internet options to delete it. Somehow it hoses all http requests to the server itself, and bogs down all connections. That’s how I know when to go in and delete. I think it keeps getting installed via somebody opening an email from the federal government, whom we do business with.

Is there a way to programmatically delete that cert if it exists every hour?
0
Comment
Question by:QMBB
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 7

Expert Comment

by:twol
ID: 36969717
Sure, create the batch file, then go into control panel, scheduled tasks, and set the process up to run every hour.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 36969842
well your issue sounds a bit bizarre but if this fixes it, and you cant find the cause then i guess you could use

cer
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:QMBB
ID: 36969849
twol, I am familiar with creating and running and scheduling batch files, the question is more where do the certs live and do they have permissions which will not allow deletion via batch?

twohawks… I was hoping to do this via simple batch file, without having to download more tools.
0
 

Author Comment

by:QMBB
ID: 36969925
cer ?
0
 
LVL 13

Expert Comment

by:Govvy
ID: 36970068
Certutil -delstore
0
 

Author Comment

by:QMBB
ID: 36970084
Would Certutil -delstore delete all of them? I only want to delete a specific cert.
0
 
LVL 13

Accepted Solution

by:
Govvy earned 1400 total points
ID: 36970118
No you specify store and certID:

Certutil -delstore <CertificateStoreName> <CertId>
0
 
LVL 8

Assisted Solution

by:twohawks
twohawks earned 200 total points
ID: 36970135
Unfortunately I am not an expert on this, although I have dabbled in certs.
For sure, however, it seems you are limited to using the Certutil.exe utility in order to handle this from a command line or batch.

I have not seen a wmi or powershell standalone method, and MS only directs us to usage of the Certutil.

The venerable Dan Rollins posted an answer to a similar inquiry in 2008
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/Q_23211645.html
0
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 400 total points
ID: 36970432
Hmm, yes sorry my post cut off earlier!  As has been since the certutil.exe was what I was posting about..

I had typed before along the lines of

Check what is shown by

certutil -store

and then use certutil -delstore to remove it if so.

Sorry for the cut-off post earlier, phoned must have mangled it!

Steve
0
 
LVL 8

Expert Comment

by:twohawks
ID: 36989625
Thanks for the assist points, QMBB.  
0
 

Author Comment

by:QMBB
ID: 36989659
Thank you.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question