Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I find the total number of sites hosted in an instance of IIS 7? It doesn't matter if it is in PowerShell, I just can't seem to find some trival way to find this information...

share|improve this question

Use appcmd.
Open cmd and execute:

  • For 32 Bits

C:\Windows\System32\inetsrv\appcmd list site > C:\temp\websites.txt

  • For 64 Bits

C:\Windows\SysWOW64\inetsrv\appcmd list site > C:\temp\websites.txt

Your ouput file will have a full description of all sites in IIS 7.
Open the file with some text editor with line numbers, or use excel and take a look on total rows.

share|improve this answer

The appcmd mentioned previously is pretty cool. But if you start Powershell and type:


You'll get a pretty listing of all the configured websites and bindings:

Name             ID   State      Physical Path                  Bindings
----             --   -----      -------------                  --------
Default Web Site 1    Stopped    %SystemDrive%\inetpub\wwwroot  http *:80:
                                                                net.tcp 808:*
                                                                net.pipe *
                                                                net.msmq localhost
                                                                msmq.formatname localhost

You might need to add the IIS WebManagement snapin. But if you start Powershell from the Administrative Tools folder, it'll have the snapin already loaded.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.