Solved

Script to install a .cer

Posted on 2012-04-02
6
997 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Expert Comment

by:WebF00L
ID: 37797269
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
ID: 37797292
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
ID: 37797314
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
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 
LVL 35

Accepted Solution

by:
Joseph Daly earned 500 total points
ID: 37797324
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
ID: 37797459
Thx.  I tweeked a little but it worked.  Much appreciated.
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 37797594
Glad to hear. good luck.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

739 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