Here is the quickly written vbscript:
running = False
Dim oCatalog
Set oCatalog = CreateObject("COMAdmin.COMAdminCatalog")
sName = "Tridion Content Manager"
Dim result
set apps = oCatalog.GetCollection("Applications")
apps.Populate
For Each app In apps
If app.Name = sName Then
Set objAppInst = apps.GetCollection("ApplicationInstances",app.Key)
objAppInst.Populate
for each inst in objAppInst
pId = inst.Value("ProcessID")
running = not ( inst.Value("IsPaused") or inst.Value("HasRecycled"))
if running then
Exit For
end if
Set objAppInst = nothing
Next
Exit For
End If
Next
set apps = Nothing
set oCatalog = nothing
MsgBox pid & " " & running
No comments:
Post a Comment