Vbsedit includes all these samples. Try it now!

' View an SMS Collection

On Error Resume Next

Dim objSWbemServices
Dim ProviderLoc
Dim Location
Dim colQueryCollectionResults
Dim ObjResult

Dim objQuery
Dim colQueryResults

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

'Query Collection

Set colQueryCollectionResults=objSWbemServices.ExecQuery _
    ("SELECT * FROM SMS_FullCollectionMembership WHERE CollectionID='SMS00001'" )

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

'run query

Wscript.Echo "Collections"
Wscript.Echo "----------------------------------"

For Each objResult In colQueryCollectionResults
    Wscript.Echo "     " + objResult.Name
If colQueryCollectionResults.Count=0 Then
    Wscript.Echo "      no query results"
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