mirror of
https://github.com/sstent/Scripts.git
synced 2026-01-26 15:12:27 +00:00
26 lines
1.0 KiB
Plaintext
26 lines
1.0 KiB
Plaintext
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) |