WorkerProcessContainsAppDomain クラス 2
ワーカー プロセスとそのアプリケーション ドメインの間のリレーションシップを提供します。
構文
class WorkerProcessContainsAppDomain : ObjectContainerAssociation
メソッド
このクラスにはメソッドが含まれていません。
プロパティ
次の表は、WorkerProcessContainsAppDomain
クラスによって公開されるプロパティの一覧です。
名前 | 説明 |
---|---|
Container |
(ObjectContainerAssociation から継承。)IIS ワーカー プロセスを表す読み取り専用の WorkerProcess オブジェクト。 キー プロパティ。 |
Element |
(ObjectContainerAssociation から継承。)IIS アプリケーション ドメインを表す読み取り専用の AppDomain オブジェクト。 キー プロパティ。 |
サブクラス
このクラスにはサブクラスが含まれていません。
解説
この関連付けクラスは、Web サーバー上の各ワーカー プロセスについて、読み込まれたすべてのアプリケーション ドメインを取得する場合に役立ちます。
例
次の例では、Web サーバーで読み込まれたアプリケーション ドメインを示します。 最初の部分では、WMI クエリを使用します。 2 番目の部分では、WorkerProcessContainsAppDomain
関連付けクラスを使用します。
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get application domains on the server by using a WMI query.
Set AppDomains = oWebAdmin.ExecQuery ("Select * from AppDomain")
WScript.Echo "AppDomain Count: " & AppDomains.Count
WScript.Echo
For Each AppDomain In AppDomains
WScript.Echo "AppDomain site name: " + AppDomain.SiteName
WScript.Echo "AppDomain process ID: " & AppDomain.ProcessID
WScript.Echo "AppDomain ID: " + AppDomain.Id
WScript.Echo "AppDomain application path: " & _
AppDomain.ApplicationPath
WScript.Echo
Next
WScript.Echo
' Get the application domains for each worker process by using
' the WorkerProcessContainsAppDomain association.
Set oWorkerProcesses = oWebAdmin.InstancesOf("WorkerProcess")
For Each oWorkerProcess In oWorkerProcesses
WScript.Echo "Worker Process Process ID: " & oWorkerProcess.ProcessID
Set oAppDomains = _
oWorkerProcess.Associators_("WorkerProcessContainsAppDomain")
WScript.Echo "AppDomainCount: " & oAppDomains.Count
WScript.Echo
WScript.Echo "List of AppDomains"
WScript.Echo "------------------"
For Each oAppDomain In oAppDomains
WScript.Echo "Application domain process ID: " & _
oAppDomain.ProcessId
WScript.Echo "Application domain application path:" & _
oAppDomain.ApplicationPath
WScript.Echo " Application domain physical path: " & _
oAppDomain.PhysicalPath
WScript.Echo
Next
Next
前のコード例にある、次の構文に注意してください。
Set oAppDomains = _
oWorkerProcess.Associators_("WorkerProcessContainsAppDomain")
コードを簡略化するために、次の構文を代わりに使用できます。これにより、正確な名前を覚えずに関連付けを使用できます。
Set oAppDomains = oWorkerProcess.Associators_(, "AppDomain")
継承階層
WorkerProcessContainsAppDomain
要件
型 | 説明 |
---|---|
クライアント | - 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 |
参照
AppDomain クラス
ObjectContainerAssociation クラス
WorkerProcess クラス