Solved

Script to install a .cer

Posted on 2012-04-02
6
962 Views
Last Modified: 2012-04-02
Is there a script or a way to remotely install a .cer self signed.  I know you can via a GPO but I have so many I really would rather make this a one time install.
0
Comment
Question by:WellingtonIS
6 Comments
 
LVL 3

Expert Comment

by:WebF00L
Comment Utility
Bat file using the certmgr tool?

http://msdn.microsoft.com/en-us/library/e78byta0(v=vs.80).aspx

//WebFooL Untangle.com Evangelist
0
 
LVL 6

Expert Comment

by:Raquero
Comment Utility
If you are using multiple internal self-signed certs, consider implementing a Certificate Authority. Properly implemented, clients will automatically trust most certs issued from the CA (code signing certs is one example where this is not the case, they still have to be imported to the local trust store on clients).
0
 
LVL 35

Expert Comment

by:Joseph Daly
Comment Utility
I have done this before with a batch file. It is very simple command is below.

certmgr.exe -add C:\test.cer -s -r localMachine root

Certmgr.exe is not installed by default on XP machines so you will need to have it on the machine before you can use it.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 35

Accepted Solution

by:
Joseph Daly earned 500 total points
Comment Utility
Below is a small PSexec script that will copy certmgr.exe from a network location to your target machine and then run the certmgr.exe tool. Downlaod PStools and run this BAT file from within that folder.


@echo off
set /p var= Enter Computer Name:
set /p var2= Enter username:
set /p var3= Enter Password:

psexec -u domain\%var2% -p %var3% \\%var% cmd /c copy "\\uncpath\test.cer" C:\
psexec -u domain\%var2% -p %var3% \\%var% cmd /c copy "\\uncpath\certmgr.exe" C:\

psexec -u domain\%var2% -p %var3% \\%var% cmd /c c:\certmgr.exe -add C:\test.cer -s -r localMachine root


pause
0
 

Author Closing Comment

by:WellingtonIS
Comment Utility
Thx.  I tweeked a little but it worked.  Much appreciated.
0
 
LVL 35

Expert Comment

by:Joseph Daly
Comment Utility
Glad to hear. good luck.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Learn about cloud computing and its benefits for small business owners.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now