ApplicationPool.RevertToParent Method1
アプリケーション プールの 1 つまたは複数の構成値を既定値に戻します。
構文
ApplicationPool.RevertToParent(PropertyName)
ApplicationPool.RevertToParent(PropertyName);
Parameters
件名 | 説明 |
---|---|
PropertyName |
ApplicationPoolElementDefaults クラスで指定された既定値に戻すアプリケーション プール プロパティの名前を含むオプションの string 値。 このプロパティは入れ子にすることができます。 |
戻り値
このメソッドは値を返しません。
解説
パラメーターを指定せずに RevertToParent
を呼び出すと、アプリケーション プールのすべてのカスタム構成値が削除されます。 これが目的の動作でない場合は、メソッドに対する個別のパラメーター化された呼び出しを使用して、特定のプロパティを元に戻します。
例
次の例では、ContosoAppPool
の AutoStart
プロパティを現在の値 false
から既定値の 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
要件
型 | 説明 |
---|---|
クライアント | - 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 |
Product | - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0 |
MOF ファイル | WebAdministration.mof |