I have been looking around for a solution for this problem that works across different versions of Windows Server & IIS, but so far I couldn't find a reasonable solution, what I need is some sort of a script or a command line tool, that takes a certificate file (pfx) for example and then either using the same script or tool find a way to configure one website to use this certificate.
views:
46answers:
1
A:
I found a good script on TechNet
CertImport.vbs
Option Explicit
Dim iiscertobj, pfxfile, pfxfilepassword, InstanceName, WebFarmServers, IISServer
Set iiscertobj = WScript.CreateObject("IIS.CertObj")
pfxfile = WScript.Arguments(0)
pfxfilepassword = WScript.Arguments(1)
InstanceName = WScript.Arguments(2)
WebFarmServers = split(WScript.Arguments(3), ",")
iiscertobj.UserName = WScript.Arguments(4)
iiscertobj.UserPassword = WScript.Arguments(5)
For Each IISServer in WebFarmServers
iiscertobj.ServerName = IISServer
iiscertobj.InstanceName = InstanceName
iiscertobj.Import pfxfile, pfxfilepassword, true, true
Next
bashmohandes
2010-02-26 03:27:19