简体   繁体   中英

get Application pool version from IIS6-IIS7

Hello i want to get framework version from all my application pool (with IIS 6/7). This is how i get application pool name:

Dim AppPools As DirectoryEntry = New DirectoryEntry("IIS://localhost/W3SVC/AppPools")Then
     For Each nextEntry As DirectoryEntry In AppPools.Children
            Dim nextAppPoolName As String = nextEntry.Name
            Dim pipelineMode As Integer = CInt(nextApplicationPool.Properties(MANAGED_PIPELINE_MODE).Value)                  
     Next

i can get framework from my web sites but i don't want this. how i can to do?

We use IIS-api for IIS7:

using (var iisManager = ServerManager.OpenRemote(iisServer))
{
    var site = iisManager.Sites[IisSite];
    var app = site.Applications[0];

    var pool = iisManager.ApplicationPools[app.ApplicationPoolName];
}

Where iisServer is name of your server (localhost), IisSite - name of site on server, app - first (default) apllication of this site and pool - your apllication pool.

More information about pool api and ServerManager . I hope, you can translate it to VB.

IIS6 has no api and almost has any "good" way to get this information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM