I am iterating through DMO's registered servers and I want to detect whether a particular server is running ie the service has started...bearing in mind that some of these are on remote machines.... How can I do this through DMO or do I have to use the API? Below is what I have so far...

VB Code:
  1. Dim oSQLApp As New SQLDMO.Application
  2.  
  3.  
  4. Private Sub Command1_Click()
  5.  
  6. Dim oServer As New SQLDMO.RegisteredServer
  7. Dim oServerGroup As New SQLDMO.ServerGroup
  8. Dim oServerSubGroup As New SQLDMO.ServerGroup
  9. Dim oDatabase As New SQLDMO.Database
  10.  
  11.     For Each oServerGroup In oSQLApp.ServerGroups
  12.         With tvwMain
  13.             .Nodes.Add , , oServerGroup.Name, oServerGroup.Name
  14.             For Each oServer In oServerGroup.RegisteredServers
  15.                 .Nodes.Add oServerGroup.Name, tvwChild, oServerGroup.Name & "\" & oServer.Name, oServer.Name
  16.             Next
  17.         End With
  18.        
  19.     Next
  20.    
  21. End Sub
  22.  
  23.  
  24. Private Sub tvwMain_NodeClick(ByVal Node As MSComctlLib.Node)
  25.  
  26. Dim oSQLServer As New SQLDMO.SQLServer
  27. Dim oDatabase As New SQLDMO.Database
  28. Dim oTable As New SQLDMO.Table
  29.    
  30.     If Node.Parent Is Nothing Then
  31.         Exit Sub
  32.     End If
  33.    
  34.     If Node.Parent = "SQL Server Group" Then
  35.         oSQLServer.Connect Node.Text, "poo", "plop"
  36.     Else
  37.         Exit Sub
  38.     End If
  39.    
  40.     For Each oDatabase In oSQLServer.Databases
  41.         With tvwMain
  42.             .Nodes.Add Node.Key, tvwChild, Node.Key & "\" & oDatabase.Name, oDatabase.Name
  43.             For Each oTable In oDatabase.Tables
  44.                 .Nodes.Add Node.Key & "\" & oDatabase.Name, tvwChild, Node.Key & "\" & oDatabase.Name & "\" & oTable.Name, oTable.Name
  45.             Next
  46.         End With
  47.     Next
  48.    
  49. End Sub