简体   繁体   中英

Need to list all sites, app pools, and sub apps in IIS 6.0 (Server 2k3)

Server 2003 is being phased out and we are currently trying to round up all the websites and apps being hosted on our few remaining 2k3 servers. The problem is I can't use appcmd to list them and iisapp doesn't list all the applications installed.

What I have resorted to is exporting the iis config on all the servers into various xml files (via batch file) and then using powershell to search through each xml for specific regex strings like "AppFriendlyName", etc. This gets exhausting sometimes when the appfriendlyname is set to "Default Application" since it doesn't really tell you what the app is that uses it.

Is there some easier way to get all the app pools and app pool paths in one list for IIS6.0?

There is no easy way to work with IIS6 from PowerShell as far as I know. I think you are on the right track. Export IIS6 config to an XML file.

& {iiscnfg /export /f c:\inetpub\config.xml /sp / /children}

Then you can use PowerShell to parse the XML.

$cfg = [Xml] (Get-Content "c:\inetpub\config.xml")

With $cfg PSObject containing you IIS config you can now extract whatever data you need. For example:

$cfg.configuration.MBProperty.IIsWebDirectory | Select-Object Location, AppFriendlyName, AppPoolId

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