-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgetweb.vbs
More file actions
26 lines (25 loc) · 1.02 KB
/
getweb.vbs
File metadata and controls
26 lines (25 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Option Explicit
On Error Resume Next
Dim StartTime,EndTime: StartTime = Now ' For seeing how long the script takes to run
Wscript.Echo "StartTime = " & StartTime
' ***************************************************************** '
Dim objParent, strSite, ComputerName, strOutput
ComputerName = "pnymvp01"
Set objParent = GetObject("IIS://" & ComputerName & "/W3SVC")
If err.number <> 0 Then
Wscript.Echo "Error enumerating sites on: " & ComputerName & " - " & err.number & " - " & err.description
Else
Wscript.Echo "Enumerating sites on: " & ComputerName
End If
For Each strSite in objParent
If IsNumeric(strSite.Name) Then
strOutput = strSite.Name & " - " & strSite.ServerComment
Wscript.Echo strOutput
End If
Next
' ***************************************************************** '
EndTime = Now
'Wscript.Echo vbCrLf & "EndTime = " & EndTime
'Wscript.Echo "Seconds Elapsed: " & DateDiff("s", StartTime, EndTime)
Wscript.Echo "Script Complete"
Wscript.Quit(0)