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
Solved

Script to install a .cer

Posted on 2012-04-02
6
986 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
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

OfficeMate Freezes on login or does not load after login credentials are input.
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…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

828 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