Board logo

标题: [转贴] VBS脚本创建SMS集合 [打印本页]

作者: VBScript    时间: 2012-4-8 18:58     标题: VBS脚本创建SMS集合

  1. strSiteServer = InputBox ("站点服务器名")
  2. strSiteCode = InputBox ("站点代码")
  3. strCollName = InputBox ("新集合名称")
  4. strCollComment = InputBox ("集合描述")
  5. Set objLocator = CreateObject("WbemScripting.SWbemLocator")
  6. Set objService = objLocator.ConnectServer(strSiteServer, "root/sms/site_" & strSiteCode)
  7. Set objCollection = objService.Get("SMS_Collection").SpawnInstance_()
  8. objCollection.Name = strCollName
  9. objCollection.comment = strCollComment
  10. objCollection.OwnedByThisSite = TRUE
  11. Path = objCollection.Put_
  12. Set Collection = objService.Get(path)
  13. objCollectionid = Collection.CollectionID
  14. Set objCollectionRelation = objService.Get("SMS_CollectToSubCollect").SpawnInstance_()
  15. objCollectionRelation.parentCollectionID = "CollRoot"
  16. objCollectionRelation.subCollectionID = objCollectionID
  17. objCollectionRelation.Put_
  18. Set Token = objService.Get("Sms_St_RecurInterval")
  19. Token.HourSpan = 2
  20. Collection.RefreshSchedule = Array(Token)
  21. Collection.RefreshType = 2
  22. Collection.Put_
  23. MsgBox "Done"
复制代码


http://prain.blog.51cto.com/162681/245980




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2