Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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

get-website

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
add comment

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
add comment

Your Answer

 
discard

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.