1

I have a server that has hosted many sites over the years... as many as a hundred. I've got a lot of cruft in \inetpub\wwwroot that has not been well managed. Say I have a directory called "SomeDirectory". Is there any easy way to tell if any site in IIS 7.5 is bound to this physical location without going through them one by one?

1 Answer 1

1

To just see if a site uses the virtual Directory "SomeDirectory" you would use

appcmd list vdir /app.name: SITENAME / SomeDirectory (exchanging SITENAME with the name of your site).

However if you want to give a physical directory and get all sites using it you need a more complicated command, piping the output from list vdir to list app to list site:

appcmd list vdir /physicalPath:C:\inetput\wwwroot\SomeDir /xml | appcmd list app /xml /in | appcmd list site /in (exchange the physical path according to your needs).

2
  • Great, thanks Broco. I simplified it a great deal by just doing "appcmd list vdir | findstr MyDirectoryName"
    – user21146
    Aug 14, 2014 at 22:43
  • I should really work on simplifying things... Glad it helped though.
    – Broco
    Aug 14, 2014 at 22:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .