From: reiner.buehl on
Hi all,

I would like to check the status of a COM+ component from a VBScript. I
found the COMAdminCatalog.ServiceCheck function which seems to do
exactly what I want but I can not find where to get the parameter for
this function from. The function expects a parameter of type "long"
that defines which service/component to check. However all the possible
candidates like Name, ApplicationID or ID are all strings.

My current code looks like this:
Dim sAppName
sAppName = "Provisioning Engine"
Set objCatalog = CreateObject("COMAdmin.COMAdminCatalog")
Dim apps
Set apps = objCatalog.GetCollection("Applications")
apps.Populate

' Enumerate through applications looking for AppName.
Dim app
Dim state
For Each app In apps
If app.Name = sAppName Then
state = objCatalog.ServiceCheck(app.Value("ServiceName"))
Wscript.Echo state
End If
Next

All I get is a type mismatch error when calling
objCatalog.ServiceCheck. How can I use this methode?

Best regards,
Reiner.

 | 
Pages: 1
Prev: how to call vbe from wsf ?
Next: compile hta file