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"
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"
相关文章推荐
- [转]利用adsutil.vbs脚本创建自定义web站点
- VBS脚本教程:连续的创建文件
- xp、2003开3389+非net创建管理用户+Shift后门+自删除脚本vbs
- 利用VBS脚本自动创建计算机帐户的代码
- 利用adsutil.vbs脚本创建自定义web站点
- VBS脚本批处理创建域用户【可自动设置用户密码,创建OU】[转]
- vbs脚本创建Windows账户
- 利用adsutil.vbs脚本创建自定义web站点
- 利用adsutil.vbs脚本创建自定义web站点
- 使用WINDOWS的VBS脚本,创建自己的文件类型!
- loadrunner 创建脚本时弹出IE错误处理方法
- Hibernate根据配置文件生成表结构和创建表的脚本
- QTP中VBS脚本下FSO、WSH的应用——实例讲解
- ◎Vbs脚本编程简明教程之六—修改注册表
- 定时计划任务方案比较以及通过脚本创建计划任务(SchTasks命令)
- MS SQL 中判断 数据库, 存储过程,表,临时表,视图,函数,用户,用户创建对象 等是否存在 SQL脚本
- 关于sh脚本创建msyql相同结构表 场景数据库分表
- Oracle创建自己启动脚本
- 创建标准化工程目录脚本