This Vbs script will take an SMS site server name and site code from an input box and then enumerate all of the SMS Web Reports on that server. It will then add them to a Microsoft Word document that you can save for future reference. You can also save the document as a webpage or as an XML document if you are using Microsoft Word 2003.
Note: The script uses the SMS_Report class and exposes its SQLQuery lazy property by using the GET instance for the object property and links the Report ID for the appropriate reports. For more information on lazy properties see the link at the end of this post.
Vbs Script:
strComputer = InputBox ("Enter Site Server Name")
strSiteCode = InputBox("Enter Site Code")
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
objSelection.Font.Bold = True
objSelection.TypeText "SMS Web Reports For " & UCase(strComputer)
objSelection.Font.Bold = False
objSelection.TypeParagraph()
objSelection.TypeText "Report Created: " & Date
Set objWMIService = GetObject("winmgmts://" & strComputer & "\root\sms\site_" & strSiteCode)
Set colItems = objWMIService.ExecQuery("Select * from SMS_Report")
For Each objItem in colItems
ReportQuery(objItem.ReportID)
Next
Function ReportQuery(ReportID)
Set lazyproperties = objWMIService.Get("SMS_Report.ReportID=" & ReportID)
objSelection.TypeText lazyproperties.Name
objSelection.TypeText lazyproperties.SQLQuery
End Function
MsgBox "Done"
Those Lazy SMS Properties:
http://myitforum.com/cs2/blogs/dhite/archive/2006/11/17/those-lazy-sms-properties.aspx
When you upgrade your SMS 2003 site to Service Pack (SP) 3 the following new additional asset management
This Vbs script will take an SMS site server name and site code from an input box and then enumerate
How about one to export all SMS Collection queries?
f4jock@gmail.com
Thanks
VBS Script To Export SMS Queries To Microsoft Word
myitforum.com/.../vbs-script-to-export-sms-queries-to-microsoft-word.aspx
Don
Thanks, but the queries do not include the collections (collection queries/code) that we need to backup. We rarely use the queries feature of SMS, but of course the queries within our collections are extremely important! Isn't there a table holding these collection queries somewhere? It would be great to see a Vb script that could extract these.
Thanks.