list All the hosted website from command line on IIS
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
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
Please try power shell script
Get-WebApplication