What a pain. To get a cert request from IE so that the private key stays in Windows.
Try this script (save as something.vbs) and run it on your server, logged in as the IDNRequestD login.
set Enroll = createobject("CEnroll.CEnroll")
Dim varName
' Enable error handling.
On Error Resume Next
' Attempt to use the control, in this case to retrieve a property.
varName = Enroll.MyStoreName
' If above line failed, Err.Number will not be 0.
if ( Err.Number <> 0 ) then
MsgBox("Error!")
Err.clear
else
' The control property was successfully retrieved,
' display the property value.
varName = "MyStoreName is " & varName
end if
Dim strDN
Dim strSvr
Dim strLogin
Dim strOrg
Dim strOU
Dim strCity
Dim strState
Dim strCountry
strSvr = "www.something.com"
strLogin = "something.something.com"
strOrg = "Someghing Inc"
strOU = "NA"
strCity = "Tyson"
strState = "New Mexico"
strCountry = "US"
strDN = "CN=" & strSvr & ":" & strLogin & ",OU=" & strOU & ",O=" & strOrg & ",L=" & strCity & ",S=" & strState & ",C=" & strCountry
Dim strReq
strReq = Enroll.CreatePKCS10(strDN, "1.3.6.1.4.1.311.2.1.21")
fstr = "-----BEGIN NEW CERTIFICATE REQUEST-----" & vbcrlf & strReq & "-----END NEW CERTIFICATE REQUEST-----"
StrFileName = "C:\Documents and Settings\IDNRequestD\reqFile.txt"
Set ObjFso = CreateObject("Scripting.FileSystemObject")
'Creating a file for writing data
Set ObjFile = ObjFso.CreateTextFile(StrFileName)
'Writing a string into the file
ObjFile.Write(fstr)
'Closing the file
ObjFile.Close
Saturday, January 1, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment