Ray Lu
Ray Lu

Reputation: 26658

Configure IIS 6 website SSL port programmatically?

I am trying to configure the website SSL port with the certificate for a website within IIS 6.0 programmatically.

IIS 7.0 provides the API, ServerManager, to do so, but I am not sure if there is something similar for IIS 6.0 or command line utilities.

Thanks in advance!

Upvotes: 5

Views: 2673

Answers (1)

Eric Rosenberger
Eric Rosenberger

Reputation: 9117

If you mean just setting the port NUMBER programmatically, you can use the metabase command line tool (by default in C:\Inetpub\AdminScripts):

cscript adsutil.vbs set w3svc/1/securebindings ":nnn:"

where nnn is the port number (e.g., ":443:"). (If you have more than one site on the server, you will need to substitute w3svc/x/securebindings, where x is the web site ID.)

If you actually need to install the CERTIFICATE programmatically, from what I gather there's a script in the IIS 6.0 Resource Kit to do it (IISCertDeploy.vbs) but I've not tried it.

Upvotes: 7

Related Questions