VBS Script To Enumerate SMS SP3 Auto Start Software And Send To Excel

 

Sms_AutoStartSoftware is a new WMI class provided by the installation of SMS Service Pack (SP) 3 that allows for you to see or enumerate the applications set to automatically start when the Operation System is started. The VBS script here will prompt you for an SMS SP3 client machine name and then will list all of the Auto Start applications on the machine to an Excel spreadsheet.

 

VBS Script:

 

strComputer = InputBox ("Enter SMS Client SP3 Name")

 

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

objExcel.Workbooks.Add

intRow = 2

 

objExcel.Cells(1, 1).Value = "Description"

objExcel.Cells(1, 2).Value = "File Name"

objExcel.Cells(1, 3).Value = "File Version"

objExcel.Cells(1, 4).Value = "Publisher"

objExcel.Cells(1, 5).Value = "Product"

objExcel.Cells(1, 6).Value = "Product Version"

objExcel.Cells(1, 7).Value = "Startup Type"

objExcel.Cells(1, 8).Value = "Startup Value"

objExcel.Cells(1, 9).Value = "Location"

 

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2\Sms")

Set colItems = objWMIService.ExecQuery("Select * From Sms_AutoStartSoftware")

For Each objItem in colItems

objExcel.Cells(intRow, 1).Value = objItem.Description

objExcel.Cells(intRow, 2).Value = objItem.FileName

objExcel.Cells(intRow, 3).Value = objItem.FileVersion

objExcel.Cells(intRow, 4).Value = objItem.Publisher

objExcel.Cells(intRow, 5).Value = objItem.Product

objExcel.Cells(intRow, 6).Value = objItem.ProductVersion

objExcel.Cells(intRow, 7).Value = objItem.StartupType

objExcel.Cells(intRow, 8).Value = objItem.StartupValue

objExcel.Cells(intRow, 9).Value = objItem.Location

intRow = intRow + 1

Next

 

objExcel.Range("A1:I1").Select

objExcel.Selection.Interior.ColorIndex = 19

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True

objExcel.Cells.EntireColumn.AutoFit

 

MsgBox "Done"

 

Published Sunday, May 27, 2007 8:31 AM by dhite
Filed under:

Comments

No Comments