ApplicationPool.RevertToParent Method1

Reverts an application pool's configuration value or values to the default.

Syntax

ApplicationPool.RevertToParent(PropertyName)  
ApplicationPool.RevertToParent(PropertyName);  

Parameters

Name Description
PropertyName An optional string value that contains the name of the application pool property that is to be reverted to the default specified by ApplicationPoolElementDefaults Class. The property can be nested.

Return Value

This method does not return a value.

Remarks

When you call RevertToParent without parameters, all custom configuration values for the application pool will be removed. If this is not the behavior you want, revert specific properties by using separate parameterized calls to the method.

Example

The following example reverts the AutoStart property of the ContosoAppPool from its current value of false to the default value of true.

' Connect to the WMI WebAdministration namespace.  
Set oWebAdmin = GetObject( _  
    "winmgmts:root\WebAdministration")  
  
' Get the application pools.  
Set oAppPools = oWebAdmin.InstancesOf("ApplicationPool")  
  
' Display the ContosoAppPool AutoStart property.  
For Each oAppPool In oAppPools  
    If oAppPool.Name = "ContosoAppPool" Then  
        WScript.Echo "Application pool name: " & oAppPool.Name  
        WScript.Echo "AutoStart mode before revert: " & _  
            oAppPool.AutoStart  
  
        ' Revert the AutoStart property.  
        oAppPool.RevertToParent("AutoStart")  
  
        ' Refresh the oAppPool object variable.  
        oAppPool.Refresh_  
  
        ' Display the changed property.  
        WScript.Echo "AutoStart mode after revert: " & _  
                oAppPool.AutoStart  
  
        Exit For  
    End If  
Next  
  
' Output:  
' Application pool name: ContosoAppPool  
' AutoStart mode before revert: False  
' AutoStart mode after revert: True  
  

Requirements

Type Description
Client - IIS 7.0 on Windows Vista
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on Windows Server 2008
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
MOF file WebAdministration.mof

See Also

ApplicationPool Class
ApplicationPoolElementDefaults Class