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.

74 lines
1.7 KiB

  1. <job id="Cluster Private Properties">
  2. <reference guid="{f2e606e0-2631-11d1-89f1-00a0c90d061e}" version="1.0" />
  3. <script language="VBScript">
  4. Option explicit
  5. RunTest
  6. Sub RunTest
  7. 'On Error Resume Next
  8. Dim oCluster
  9. Dim varValue
  10. Dim collRegistryKeys
  11. Set oCluster=CreateObject( "MSCluster.Cluster" )
  12. oCluster.Open( "GALENB-CLUS" )
  13. oCluster.ResourceTypes.CreateItem "8testRes", "8testRes", "testRes.dll", 5000, 60000
  14. if err.Number <> 0 then
  15. MsgBox "Create resource type error Error: " & Err.Description
  16. Exit Sub
  17. end if
  18. Dim oResource
  19. 'Dim count
  20. 'count = oCluster.Resources.Count
  21. 'if err.Number <> 0 then
  22. ' MsgBox "Get count Error: " & Err.Description
  23. ' err.Clear
  24. 'end if
  25. set oResource = oCluster.Resources.CreateItem( "8TestResource", "8testRes", "Cluster Group",0)
  26. Dim index
  27. Dim rCount
  28. Dim key
  29. Dim keyString
  30. Set collRegistryKeys = oResource.RegistryKeys
  31. rCount = collRegistryKeys.Count
  32. if err.Number <> 0 then
  33. MsgBox "Error: " & Err.Description
  34. Exit Sub
  35. else
  36. MsgBox "Get RegistryKeys collection succeeded: " & oResource.Name & " Count= " & rCount
  37. end if
  38. 'keyString = "Cluster" & "\" & oResource.Name & "Key"
  39. keyString = "Software\TestKey"
  40. collRegistryKeys.AddItem keyString
  41. if err.Number <> 0 then
  42. MsgBox "Error: " & Err.Description
  43. err.Clear
  44. else
  45. MsgBox "AddRegistryKeys succeeded. Count= " & collRegistryKeys.Count
  46. end if
  47. 'collRegistryKeys.Refresh
  48. 'MsgBox "AddRegistryKeys.Count= " & collRegistryKeys.Count
  49. 'collRegistryKeys.RemoveItem collRegistryKeys.count
  50. collRegistryKeys.RemoveItem 1
  51. MsgBox "Done."
  52. End sub
  53. </script>
  54. </job>