Site.RevertToParent 메서드1
웹 사이트 구성 값 또는 값을 기본값으로 되돌려 놓습니다.
구문
Site.RevertToParent(PropertyName)
Site.RevertToParent(PropertyName);
매개 변수
속성 | Description |
---|---|
PropertyName |
SiteElementDefaults에서 지정한 기본값으로 되돌릴 웹 사이트 속성의 이름을 포함하는 선택적 string 값입니다. 속성은 중첩될 수 있습니다(예: "LogFile.Directory"). |
반환 값
이 메서드는 값을 반환하지 않습니다.
설명
매개 변수 없이 를 호출 RevertToParent
하면 웹 사이트에 대한 모든 사용자 지정 구성 값이 제거됩니다. 원하는 동작이 아닌 경우 메서드에 매개 변수가 있는 호출을 사용하여 특정 속성을 되돌리기.
예제
다음 예제에서는 기본 웹 사이트의 로그 파일 디렉터리를 %SystemDrive%\MySiteLogFiles에서 %SystemDrive%\inetpub\logs\LogFiles로 되돌려 줍니다. 이 예제에서는 ApplicationHost.config 파일의 <logFile>
기본 웹 사이트에 대한 섹션에서 이 변경 작업을 수행합니다.
참고
Site 클래스의 속성에는 LogFile
SiteLogFile 클래스의 instance 포함됩니다. SiteLogFile
instance 속성이 있습니다Directory
. 를 사용하여 oSite.RevertToParent("LogFile.Directory")
이 중첩 속성을 지정합니다.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject( _
"winmgmts:root\WebAdministration")
' Retrieve the default Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
' Display the Web site name, ID, and log file directory.
WScript.Echo "Web site name: " & oSite.Name
WScript.Echo "Site ID: " & oSite.ID
WScript.Echo "Log file directory before revert: " & _
oSite.LogFile.Directory
' Revert the log file directory to the default.
oSite.RevertToParent("LogFile.Directory")
' Update the contents of the oSite object variable.
oSite.Refresh_
' Display the change.
WScript.Echo _
"Log file directory after revert: " & _
oSite.LogFile.Directory
' Example output:
' Web site name: Default Web Site
' Site ID: 1
' Log file directory before revert: %SystemDrive%\MySiteLogFiles
' Log file directory after revert: %SystemDrive%\inetpub\logs\LogFiles
요구 사항
형식 | Description |
---|---|
클라이언트 | - Windows Vista의 IIS 7.0 - Windows 7의 IIS 7.5 - Windows 8의 IIS 8.0 - WINDOWS 10 IIS 10.0 |
서버 | - Windows Server 2008의 IIS 7.0 - Windows Server 2008 R2의 IIS 7.5 - Windows Server 2012의 IIS 8.0 - Windows Server 2012 R2의 IIS 8.5 - WINDOWS SERVER 2016 IIS 10.0 |
제품 | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
MOF 파일 | WebAdministration.mof |