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!
Open Internet Information Services (IIS) Manager. On the Start menu, click Administrative Tools > Internet Information Services (IIS) Manager. Right-click on the website that you want to use your SSL certificate to secure and then, click Properties.
In Internet Information Services (IIS) Manager, under Connections, expand your server's name, expand Sites, and then select the website on which you want to install the SSL Certificate. In the Actions menu, under Edit Site, click Bindings. In the Site Bindings window, select binding for https and then, click Edit.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With