Microsoft Operations Manager

DumpToFile Method

The DumpToFilemethod writes the contents of a VarSetobject to a file.

GetScriptState.GetScriptSet.DumpToFile(FileName String)


Specifies the name or path of the file used to store the VarSetvalues.

Return Value



Unless the FileNameparameter contains a complete folder path, the file will be created in the MOM OnePoint folder.


The following example shows how to write the contents of the specified VarSetobject to a file in the MOM OnePoint folder.

Function SaveVarSetToFile(strVarSetName)
	Dim objScriptState
	Dim objVarSet
	Dim strFileName
	Dim dtmNow

	dtmNow = Now()

	strFileName = Month(dtmNow) & "_" & Day(dtmNow) &
"_" & _ 
				Hour(dtmNow) & "_" & Minute(dtmNow) &
"_" & _ 
				Second(dtmNow) & ".dat"

	Set objScriptState = ScriptContext.GetScriptState()
	Set objVarSet = objScriptState.GetSet(strVarSetName)
	Call objVarSet.DumpToFile(strFileName)

	Set objScriptState = Nothing
	Set objVarSet = Nothing

	SaveVarSetToFile = strFileName
End Function


Windows NT/2000: Requires Windows 2000 or later
Version: Requires MOM 1.0 SP1

See Also

VarSet Object

Did you find this information useful? Please send your suggestions and comments about the documentation to