コマンドでSSLのバインドを構成する [IIS6.0]
バインドを構成する
1つのIPアドレスで複数のサイトを運営するには、IIS管理ユーティリティのadsutil.vbsを使用してバインドを行う必要があります。CSP SSL WildcardやCSP SSL Multi-domainをお使いの方はこちらの手順を参考にしてください。
※手順と実行環境が異なる場合がございますのでご注意ください。
Webサーバの状態を確認します。スタートメニューから「管理ツール」→「インターネットインフォメーションマネージャー」を起動し、サイトをクリックしてサイト一覧を表示させてください。

設定は以下の通りです。
| 名前 | 識別子 | ホスト名 | 80(http) | 443(https) |
|---|---|---|---|---|
| 既定の Webサイト | 1 | cspssl.com | バインド済み | バインド済み |
| sales | 322395494 | sales.cspssl.com | バインド済み | |
| contact | 322395495 | contact.cspssl.com | バインド済み |
サイト一覧を表示させた状態でコマンドプロンプトを起動させ[c:\inetpub\AdminScripts]へ移動します。
> cd c:\inetpub\AdminScripts
他のサイトへ443(SSLポート)のバインドを行ないます。下記コマンドを入力してください。
> cscript.exe adsutil.vbs SET /w3svc/<識別子>/SecureBindings ":443:<ホスト名>"
[例] C:\Inetpub\AdminScripts>cscript.exe adsutil.vbs SET /w3svc/322395494/SecureBindings ":443:sales.cspssl.com" Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. SecureBindings : (LIST) ":443:sales.cspssl.com"
バインドの状況を確認します。下記コマンドを入力して443バインドの表示させてください。
> cscript.exe adsutil.vbs GET /w3svc/<識別子>/SecureBindings
[例] C:\Inetpub\AdminScripts>cscript.exe adsutil.vbs GET /w3svc/322395494/SecureBindings Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. SecureBindings : (LIST) (1 Items) ":443:sales.cspssl.com"
以下へ更新されました。
| 名前 | ホスト名 | 80(http) | 443(https) |
|---|---|---|---|
| Default Web Site | cspssl.com | バインド済み | バインド済み |
| contact | contact.cspssl.com | バインド済み | バインド済み |
| sales | sales.cspssl.com | バインド済み |
インターネットインフォメーションマネージャーで、SSLポートが更新されていることを確認してください。

バインドを削除する
Webサーバの状態を確認します。スタートメニューから「管理ツール」→「インターネットインフォメーションマネージャー」を起動し、サイトをクリックしてサイト一覧を表示させてください。

設定は以下の通りです。
| 名前 | 識別子 | ホスト名 | 80(http) | 443(https) |
|---|---|---|---|---|
| 既定の Webサイト | 1 | cspssl.com | バインド済み | バインド済み |
| sales | 322395494 | sales.cspssl.com | バインド済み | バインド済み |
| contact | 322395495 | contact.cspssl.com | バインド済み |
サイト一覧を表示させた状態でコマンドプロンプトを起動させ[c:\inetpub\AdminScripts]へ移動します。
> cd c:\inetpub\AdminScripts
他のサイトへ443(SSLポート)のバインドを削除します。下記コマンドを入力してください。
> cscript.exe adsutil.vbs DELETE /w3svc/<識別子>/SecureBindings
[例] C:\Inetpub\AdminScripts>cscript.exe adsutil.vbs DELETE /w3svc/322395494/SecureBindings Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. deleted property "SecureBindings"
バインドの状況を確認します。下記コマンドを入力して443バインドの表示させてください。
> cscript.exe adsutil.vbs GET /w3svc/<識別子>/SecureBindings
[例] C:\Inetpub\AdminScripts>cscript.exe adsutil.vbs GET /w3svc/322395494/SecureBindings Microsoft (R) Windows Script Host Version 5.6 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. The parameter "SecureBindings" is not set at this node.
以下へ更新されました。
| 名前 | ホスト名 | 80(http) | 443(https) |
|---|---|---|---|
| Default Web Site | cspssl.com | バインド済み | バインド済み |
| contact | contact.cspssl.com | バインド済み | |
| sales | sales.cspssl.com | バインド済み |
インターネットインフォメーションマネージャーでも、SSLポートが更新されていることを確認してください。

参考サイト
[IIS 6.0: Adsutil.vbs 管理スクリプトを使用する]
http://technet.microsoft.com/ja-jp/library/cc781546(WS.10).aspx
[IIS 6.0: SSL ホスト ヘッダーのサーバーバインドを構成する]
http://technet.microsoft.com/ja-jp/library/cc756897(WS.10).aspx
