标题: [转贴] VBS脚本创建SMS集合 [打印本页]
作者: VBScript 时间: 2012-4-8 18:58 标题: VBS脚本创建SMS集合
- 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"
复制代码
http://prain.blog.51cto.com/162681/245980
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |