VBScript/IIS - 특정 웹 사이트에 대해 ASP.NET 버전을 자동으로 설정하는 방법
-
09-06-2019 - |
문제
IIS 6.0에서 앱 풀과 웹 사이트 생성을 스크립트로 작성해야 합니다.Adsutil.vbs 및 iisweb.vbs를 사용하여 이러한 항목을 만들 수 있었지만 방금 만든 사이트의 ASP.NET 버전을 2.0.50727.0으로 설정하는 방법을 모르겠습니다.
이상적으로는 Adsutil.vbs를 사용하여 메타베이스를 업데이트하고 싶습니다.어떻게 해야 하나요?
해결책
@크리스 ADSI 방식으로 나를 때려 눕혔습니다.
aspnet_regiis.exe 도구를 사용하여 이 작업을 수행할 수 있습니다.컴퓨터에 설치된 ASP.NET 버전마다 이러한 도구 중 하나가 있습니다.당신은 -
이는 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 버전을 변경하려는 웹 사이트를 호환되는 앱 풀로 전환하는 것을 잊지 마세요.ASP.NET 1.1 및 2.0 사이트는 동일한 앱 풀에서 혼합되지 않습니다.
다른 팁
다음 스크립트를 찾았습니다. 게시됨 Diablo Pup의 블로그에서.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
제휴하지 않습니다 StackOverflow