Vbsedit includes all these samples. Try it now!

' List Health Summary for Local SMS Sites

On Error Resume Next

Dim objSWbemServices
Dim ProviderLoc
Dim Location
Dim strSummarizerSiteStatus
Dim colSummarizerSiteStatus
Dim objSiteSummary


Set ProviderLoc = GetObject _

If Err.Number<;>;0 Then
    Wscript.Echo "Couldn't get SMS Provider"
End If

For Each Location In ProviderLoc.Instances_
    If Location.ProviderForLocalSite = True Then
        Set objSWbemServices = GetObject("winmgmts:" & Location.NamespacePath)
        Exit For
    End If

'Get SMS_SummarizerSiteStatus

Set colSummarizerSiteStatus=objSWbemServices.InstancesOf(strSummarizerSiteStatus)

If Err.Number<;>;0 Then
    Wscript.Echo "Couldn't get Site Summary"
End If

For Each objSiteSummary In colSUmmarizerSiteStatus
    wscript.echo "Site code:" + objSiteSummary.SiteCode
    If objSiteSummary.Status=0 Then
        Wscript.Echo "Site is healthy"
    End If
    If objSiteSummary.Status=1 Then
        Wscript.Echo "There are warnings for this site"
    End If
    If objSiteSummary.Status=2 Then
        Wscript.Echo "The site health is critical"
    End If

search for scripts

VbsEdit includes all these samples!

VbsEdit now supports .vbs, .js, .wsf and .hta scripts.
The evaluation version never expires.

Home   Scripts

Copyright © 2001-2019 adersοft