2

IIS 6.0 でアプリケーション プールと Web サイトを作成するスクリプトを作成する必要があります。adsutil.vbs と iisweb.vbs を使用してこれらを作成できましたが、作成したばかりのサイトの ASP.NET のバージョンを 2.0.50727.0 に設定する方法がわかりません。

理想的には、メタベースを更新するために adsutil.vbs を使用したいと考えています。どうすればいいですか?

4

2 に答える 2

6

@ Chrisは ADSI の方法で私を打ちのめしました

これは、aspnet_regiis.exe ツールを使用して行うことができます。マシンにインストールされている ASP.NET のバージョンごとに、これらのツールの 1 つがあります。あなたは砲撃することができます-

これにより、ASP.NET 1.1 が構成されます

%windir%\microsoft.net\framework\v1.1.4322\aspnet_regiis -s W3SVC/[iisnumber]/ROOT

これにより、ASP.NET 2.0 が構成されます

%windir%\microsoft.net\framework\v2.0.50727\aspnet_regiis -s W3SVC/[iisnumber]/ROOT

既にご存知かもしれませんが、コンピューターに 1.1 と 2.0 のサイトが複数ある場合は、ASP.NET バージョンを変更する Web サイトを互換性のあるアプリ プールに切り替えることを忘れないでください。ASP.NET 1.1 と 2.0 のサイトが同じアプリ プールに混在することはありません。

于 2008-08-21T20:01:43.327 に答える
2

DiabloPupのブログに次のスクリプトが投稿されているのを見つけました。ADSI自動化を使用します。

'******************************************************************************************
' Name: SetASPDotNetVersion
' Description: Set the script mappings for the specified ASP.NET version
' Inputs: objIIS, strNewVersion
'******************************************************************************************
Sub SetASPDotNetVersion(objIIS, strNewVersion)
 Dim i, ScriptMaps, arrVersions(2), thisVersion, thisScriptMap
 Dim strSearchText, strReplaceText

 Select Case Trim(LCase(strNewVersion))
  Case "1.1"
   strReplaceText = "v1.1.4322"
  Case "2.0"
   strReplaceText = "v2.0.50727"
  Case Else
   wscript.echo "WARNING: Non-supported ASP.NET version specified!"
   Exit Sub
 End Select

 ScriptMaps = objIIS.ScriptMaps
 arrVersions(0) = "v1.1.4322"
 arrVersions(1) = "v2.0.50727"
 'Loop through all three potential old values
 For Each thisVersion in arrVersions
  'Loop through all the mappings
  For thisScriptMap = LBound(ScriptMaps) to UBound(ScriptMaps)
   'Replace the old with the new 
   ScriptMaps(thisScriptMap) = Replace(ScriptMaps(thisScriptMap), thisVersion, strReplaceText)
  Next
 Next 

 objIIS.ScriptMaps = ScriptMaps
 objIIS.SetInfo
 wscript.echo "<-------Set ASP.NET version to " & strNewVersion & " successfully.------->"
End Sub 
于 2008-08-21T19:49:31.780 に答える