Reputation: 287
How can we list All the hosted website from command-line on IIS?
Upvotes: 18
Views: 41587
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
Reputation: 51
Please try the below command. It showed IIS site list successfully.
Get-Website
Upvotes: 5
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