Use Appcmd.exe at %systemroot%\system32\inetsrv\
- List all applications for all sites configured:
-
appcmd list app
-
- List all applications’ sites(need to be in powershell)
-
.\appcmd.exe list app /text:site.name | Sort-Object -unique
-
- List all applications’ application pool name(need to be in powershell)
-
.\appcmd.exe list app /text:apppool.name | Sort-Object -unique
-
- List all applications’ pysicalPath base on site indicated
.\appcmd.exe list app /site.name:"Default Web Site/" /text:[path='/'].physicalPath
-
# Inside git bash, the single quote ' need to be escaped to make appcmd.exe work properly
.\appcmd.exe list app /site.name:"Default Web Site/" /text:[path=\'/\'].physicalPath