다음을 통해 공유


Application.RevertToParent 메서드1

애플리케이션의 구성 값 또는 값을 기본값으로 되돌려 놓습니다.

구문

Application.RevertToParent(PropertyName)  
Application.RevertToParent(PropertyName);  

매개 변수

속성 Description
PropertyName 부모 Site 클래스의 속성으로 노출되는 ApplicationElementDefaults 클래스에서 지정한 기본값으로 되돌릴 애플리케이션 속성의 ApplicationDefaults 이름을 포함하는 선택적 string 값입니다. 되돌리기 속성은 중첩될 수 있습니다(예: "VirtualDirectoryDefaults.PhysicalPath").

반환 값

이 메서드는 값을 반환하지 않습니다.

설명

매개 변수 없이 를 호출 RevertToParent 하면 ApplicationHost.config 파일에 있는 애플리케이션에 대한 모든 설정이 제거됩니다. 원하는 동작이 아닌 경우 메서드에 대해 별도의 매개 변수가 있는 호출을 사용하여 특정 속성을 되돌리기.

예제

다음 예제에서는 기본 웹 사이트의 MyApp 애플리케이션 풀 이름을 "MyAppPool"에서 "DefaultAppPool"로 되돌립니다.

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject( _  
    "winmgmts:root\WebAdministration")  
  
' Retrieve the MyApp application from the default Web site.  
Set oApp = oWebAdmin.Get( _  
    "Application.SiteName='Default Web Site',Path='/MyApp'")  
  
' Display the site name, path, and application pool.  
WScript.Echo "Web site name: " & oApp.SiteName  
WScript.Echo "Application path: " & oApp.Path      
Wscript.Echo "ApplicationPool: " & oApp.ApplicationPool  
  
' Revert the MyApp application pool to the application pool  
' specified by the parent site's ApplicationDefaults property.  
oApp.RevertToParent("ApplicationPool")  
  
' Update the contents of the application object variable.  
oApp.Refresh_  
  
' Display the change.  
Wscript.Echo "ApplicationPool after revert: " & _  
    oApp.ApplicationPool  
  
' Example output:  
' Web site name: Default Web Site  
' Application path: /MyApp  
' ApplicationPool: MyAppPool  
' ApplicationPool after revert: DefaultAppPool  
  

요구 사항

형식 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

참고 항목

애플리케이션 클래스
ApplicationElementDefaults 클래스
사이트 클래스