widsnet.com
6Oct/110

Log all task sequence variables

Does exactly what the title says

' // ***************************************************************************
' // 
' // Logging all variables used in current Task Sequence.
' //
' // File:      ZTILogVariables.vbs
' // 
' // Version:   1.0.0.0
' // 
' // Purpose:   Find all variables and their values.
' // 
' // Usage:     cscript.exe ZTILogVariables.vbs
' // 
' // ***************************************************************************

Const ForAppending = 8

Set oTSenv = CreateObject("Microsoft.SMS.TSEnvironment") 
Set oFSO = CreateObject("scripting.filesystemobject")
Set oLogFile = oFSO.OpenTextFile(oTSenv("_SMSTSLogPath") & "\" & Replace(WScript.ScriptName, "vbs", "log"), ForAppending, True)

oLogFile.WriteLine("=== Logging all variables ===")

For Each oVar In oTSEnv.GetVariables
	oLogFile.WriteLine(oVar & ": " & oTSEnv(oVar))
Next

oLogFile.Close
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.