Javed Akhtar
Javed Akhtar

Reputation: 287

list All the hosted website from command line on IIS

How can we list All the hosted website from command-line on IIS?

Upvotes: 18

Views: 41587

Answers (4)

Timothy C. Quinn
Timothy C. Quinn

Reputation: 4485

As @WolfyUK mentioned, you may need to run the command from the inetsrv directory.

64 Bit:

%windir%\system32\inetsrv\appcmd.exe list site

32 Bit:

%windir%\syswow64\inetsrv\appcmd.exe list site

The list site command will list all sites but you can also:

List Individual Site by Name:

...\appcmd.exe list site /name:"<site_name>"

List Individual Site by Meta ID (Site ID No.):

...\appcmd.exe list site /id:<site_number>

List All Virtual Directories:

...\appcmd.exe list vdir

Upvotes: 23

Sumit Sarkar
Sumit Sarkar

Reputation: 51

Please try the below command. It showed IIS site list successfully.

Get-Website

Upvotes: 5

Avinash Vyas
Avinash Vyas

Reputation: 64

Please try power shell script

Get-WebApplication

Upvotes: 3

Tuim
Tuim

Reputation: 2511

You might have to run this as administrator.

appcmd list site

Directly from http://technet.microsoft.com/en-us/library/cc771280(v=ws.10).aspx

Upvotes: 20

Related Questions