Display a list of all sites within IIS server
- Angelo Schalley
- Oct, 23, 2009
- IIS
- No Comments
This script will show you each Web Site ID and the description and the bindings that they are using.
Save the script to a file with a .VBS file extension and then run using this command:
cscript MyFile.VBS
MachineName = “localhost” IIsObjectPath = “IIS://” & MachineName & “/w3svc” Set IIsObject = GetObject(IIsObjectPath) Set IIsObjectIP = GetObject(BindingPath) ValueList = IISObjectIP.Get(“ServerBindings”) if (HostHeader <> “”) then |
Example Output
Default Web Site ( W3SVC1 ) IP = 10.1.1.11 TCP/IP Port = 80WebSite1 ( W3SVC1036328378 ) IP = 10.1.1.74 TCP/IP Port = 80 WebSite2 ( W3SVC1816184000 ) WebSite3 ( W3SVC1867813904 ) WebSite4 ( W3SVC568530179 ) WebSite5 ( W3SVC719499532 ) WebSite6 ( W3SVC669732006 ) |