VBS – Logging the SCCM-way

Visual Basic Scripting history:

VBScript (Visual Basic Scripting Edition) is an Active Scripting language developed by Microsoft that is modeled on Visual Basic. It is designed as a “lightweight” language with a fast interpreter for use in a wide variety of Microsoft environments.

VBScript has been installed by default on every desktop release of Microsoft Windows since Windows 98, on Windows Server since Windows NT 4.0 and optionally with Windows CE.

Visual Basic Scripting is becoming an old scripting language but is still a very simple and useful language working with and around System Center Configuration Manager (SCCM).

The script snippet include 3 functions. These functions are designed to format, sort and print the information defined and current date/time when calling the function.

Set objOutputLog = oFSO.OpenTextFile ([“Log file location”], 8, True) 

Modify the above line in the script to the desired log file location

objOutputLOG.WriteLine formatTrace32Line([“Information”], [“Category”], [Highlight value]

Modify and use the above line whenever a log entry is needed within the script. Here is an example of the output using SCCM’s log parser, Cmtrace.exe/Trace32:

Download the script here.

This entry was posted in Uncategorized and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s