VBS脚本--创建SMS集合

已发表 12 八月 07 10:31 下午

This Script author is Don Hite,original text url:

http://myitforum.com/cs2/blogs/dhite/archive/2007/08/12/vbs-script-to-create-an-sms-collection.aspx

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"

作者 prain
归档在:

评论

# Forrest said on 八月 13, 2007 15:52:

I am sure who is the writer of this script. You or Don Hite or others?

http://myitforum.com/cs2/blogs/dhite/archive/2007/08/12/vbs-script-to-create-an-sms-collection.aspx

# prain said on 八月 13, 2007 22:29:

Yes,You are right!Don Hite was writer this script,I hope  share this Script to someone else

禁止匿名发表评论