您的位置:首页 > 编程语言 > VB

VBS脚本--创建SMS集合

2009-12-19 23:21 211 查看
VBS Script:
strSiteServer = InputBox ("站点服务器名")
strSiteCode = InputBox ("站点代码")
strCollName = InputBox ("新集合名称")
strCollComment = InputBox ("集合描述")
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer(strSiteServer, "root/sms/site_" & strSiteCode)
Set objCollection = objService.Get("SMS_Collection").SpawnInstance_()
objCollection.Name = strCollName
objCollection.comment = strCollComment
objCollection.OwnedByThisSite = TRUE
Path = objCollection.Put_
Set Collection = objService.Get(path)
objCollectionid = Collection.CollectionID
Set objCollectionRelation = objService.Get("SMS_CollectToSubCollect").SpawnInstance_()
objCollectionRelation.parentCollectionID = "CollRoot"
objCollectionRelation.subCollectionID = objCollectionID
objCollectionRelation.Put_
Set Token = objService.Get("Sms_St_RecurInterval")
Token.HourSpan = 2
Collection.RefreshSchedule = Array(Token)
Collection.RefreshType = 2
Collection.Put_
MsgBox "Done"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: