VBS脚本--创建SMS集合

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"

你可能感兴趣的:(脚本,职场,vbs,sms,休闲)