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.

21 lines
746 B

  1. 'Dim l As New SWbemLocator
  2. 'Dim s As ISWbemServices
  3. on error resume next
  4. Set l = CreateObject("WbemScripting.SWbemLocator")
  5. Set s = l.ConnectServer("wsms2", "root\sms\site_wn2", "administrator", "")
  6. 'This succeeds. Array (collectionRules) contains 1 element
  7. WScript.Echo UBound(s.Get("sms_collection.collectionid=""sms00001""").Properties_("CollectionRules").Value)
  8. 'This fails. Array is empty.
  9. Set Property = s.Get("sms_collection.collectionid=""collroot""").Properties_("CollectionRules")
  10. WScript.Echo Property.Name
  11. if IsNull(Property.Value) then
  12. WScript.Echo "Array value is Null"
  13. else
  14. WScript.Echo UBound(Property.Value)
  15. end if
  16. if err <> 0 then
  17. WScript.Echo Err.Description, Err.Number, Err.Source
  18. end if