Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

automating the install of the CA Root certificate

1,251 views
Skip to first unread message

G Leifheit

unread,
Jul 1, 2005, 3:15:02 PM7/1/05
to
I'm looking to automate the install of our internal CA's trusted root cert.
I need to do this on over 100 boxes. These boxes are running mostly Windows
2000 Server. I have found and modified a script that may do it, but am
having difficulty with it. I'm attaching the script, but i'm open to new
ideas as well. I always get : C:\cert\certinstall.vbs(36, 1) (null): Cannot
find the requested object. Any thoughts would be great.


Set fs = Wscript.CreateObject("Scripting.FileSystemObject")
Set MyFile = fs.OpenTextFile("c:\cert\ficatrustedroot.cer", 1)


Output = ""


Do While MyFile.AtEndOfStream <> true
line = Chr(34) & MyFile.ReadLine & Chr(34)
If MyFile.AtEndOfStream <> true then
line = line & " & _" & Chr(10)
End If
Output = Output & line
Loop


MyFile.Close


Set MyFile = Nothing
Set fs = Nothing

'on error resume next
Dim Str, CEnroll


Set CEnroll =CreateObject("CEnroll.CEnroll.1")
Str = Output

'wscript.echo Output
call CEnroll.installPKCS7(str)


Set CEnroll = Nothing


Torgeir Bakken (MVP)

unread,
Jul 1, 2005, 3:22:44 PM7/1/05
to
G Leifheit wrote:

Hi,

The command line utility certmgr.exe will most likely work better for
you, it is a cryptoAPI/Authenticode tool from MS.

To add a certificate to the "Trusted Root Certification Authorities"
in localMachine:

certmgr.exe -add -c "<cert-file>" -s -r localMachine root

where <cert-file> is the path to the certificate file.


Certmgr.exe is available in codesigningx86.exe, download it from here:

Authenticode for Internet Explorer 5.0
http://www.microsoft.com/downloads/details.aspx?familyid=2b742795-d0f0-4a66-b27f-22a95fcd3425&displaylang=en

More information can be found here:

Certificate Manager Tool (Certmgr.exe)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfcertificatemanagertoolcertmgrexe.asp

Using CertMgr
http://msdn.microsoft.com/library/en-us/security/security/using_certmgr.asp

--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

G Leifheit

unread,
Jul 1, 2005, 3:55:02 PM7/1/05
to
Does Certmgr work remotly? I want to be on one server and automate it's move
to 115 servers? I don't seem to see that functionality.

Max

unread,
Oct 31, 2008, 6:19:22 AM10/31/08
to
Hi,
I am getting error 429 when i am trying to instantiate the certenroll
by using createobject("CEnroll.CEnroll.1")
Any help would be greatly appreciated

Thanks

url:http://www.ureader.com/msg/16751651.aspx

0 new messages