iis 7 - WMI access to IIS7 -


we have internal tool enumerates iis sites , applications server. uses code similar this:

using (var servermanager = servermanager.openremote(servername)) {     var site = servermanager.sites[sitename]; // slow      // , starting enumerate applications incredibly slow     foreach (var application in site.applications)     {         // ...     } } 

the problem i'm having when sites collection accessed, response time slow when connecting server on our vpn. accessing applications site slower. theory slowness caused fact entire set of metadata sites sent on wire. however, need subset of site data.

my theory if switched code using wmi queries, i'd able query specific fields concern application (like select name site). unfortunately, when trying explore wmi objects in wmi cim studio, local iis 7.5, none of objects i'd expect present, site , application objects. i'm using root\webadministration namespace.

does of wmi stuff work iis 7.5? ensured "iis 6 wmi compatibility" turned on. there alternative lightweight ways query metadata iis instance?

  1. you can manage iis 7.5 via wmi , simplest wql query select name site output list of available sites. see "managing sites iis 7.0's wmi provider".

    note: if intend use scripts iis6, may required rewrite them. scripts iis6 won't work iis7 because methods in wmi provider of iis 6 , iis7 different.

  2. you can start cim studio way:

    1. share c:\program files (x86)\wmi tools on network , set read / write access account share.
    2. start ie , enter \\hostname\wmi tools\studio.htm url.
  3. if still can't start wmi studio, use wbemtest tool explore root\webadministration namespace.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -