Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.3 KiB

  1. '---------------------------------------
  2. ' makeg.vbs
  3. ' ~~~~~~~~~
  4. ' This is a simple vb script for testing msclus.dll.
  5. ' The script uses bugtool.exe to allow vbscript to do
  6. ' OutputDebugString. Make sure that dbmon is running
  7. ' to see output.
  8. '
  9. '------------------------------------------
  10. Dim Log
  11. Set Log = CreateObject( "BugTool.Logger" )
  12. '----------------------------------------
  13. ' Create cluster object and open it.
  14. '----------------------------------------
  15. Dim oCluster
  16. Set oCluster = CreateObject( "MSCluster.Cluster" )
  17. oCluster.Open( "worfpack" )
  18. Log.Write "Cluster Name = " & oCluster.Name & vbCRLF
  19. '----------------------------------------
  20. ' Get the first node in the cluster
  21. '----------------------------------------
  22. Dim oNode
  23. Set oNode = oCluster.Nodes(1)
  24. Log.Write "Node Name = " & oNode.Name & vbCRLF
  25. Log.Write "Node ID = " & oNode.NodeID & vbCRLF
  26. '----------------------------------------
  27. ' Get the list of resource groups in the node
  28. '----------------------------------------
  29. Dim oGroups
  30. Set oGroups = oNode.ResourceGroups
  31. '----------------------------------------
  32. ' Add a new resource group to the node
  33. '----------------------------------------
  34. Dim oGroup
  35. Set oGroup = oGroups.Add( "My New Group" )
  36. 'Set oGroup = oGroups("My New Group" ) ' or just get the existing one...
  37. '----------------------------------------
  38. ' Get the new nodes resource list.
  39. '----------------------------------------
  40. Dim oResources
  41. Set oResources = oGroup.Resources
  42. '----------------------------------------
  43. ' Add a new resource to the group
  44. '----------------------------------------
  45. Dim oResource
  46. Set oResource = oResources.Add( "SomeApp", "Generic Application", 0 )
  47. 'Set oResource = oResources( "SomeApp" )
  48. '----------------------------------------
  49. ' Set some properties on the resource
  50. '----------------------------------------
  51. oResource.PrivateProperties.Add "CommandLine", "c:\winnt\system32\calc.exe"
  52. oResource.PrivateProperties.Add "CurrentDirectory", "c:\"
  53. oResource.PrivateProperties.Add "InteractWithDesktop", 1
  54. '----------------------------------------
  55. ' Bring the resource on line
  56. '----------------------------------------
  57. oResource.OnLine
  58. '----------------------------------------
  59. ' A good script writer would close everthing
  60. ' at this point, but why bother...
  61. '----------------------------------------