Video Screencast Help

Need to Collect File Properties from all Clients

Created: 12 Mar 2013 | 1 comment

I need to scan all our clients for the date/time of a particular file that we use internally. What is the best way through NS/SMP to gather this information?

Operating Systems:

Comments 1 CommentJump to latest comment

Patrick Schmid's picture

You can gather this info with a custom inventory

You need to create a "Custom Data Class"

A task to gather this info

and a policy to do it on a schedule if you like

Here's an example I use in my environment:

1. Custom Inventory

1.1 Settings -> All Settings -> Discovery and Inventory -> Inventory Solution -> Manage Custom Data Classes

1.2 *New data class: I called it "H_Saplogonini_modifieddate" with following attributes: modifieddate

configured like: Data type = string, Maximum size = 50, Key = No, Data required = No (do not enable "multi rows")

1.2 Save it, Click on the created Data class and click the property button to note the GUID

2. Gather Task

replace the "myDataClass" GUID with your GUID and modfy the path and attributes that you might want. In my example I just want to now the modified date of the file

' On Error Resume Next

'Here, the assumption is that the data class with below guid is already configured on server.
myDataClass = "{8aaeb174-484b-4e98-a7e3-0bf27b25f3c1}"

'Create instance of Altiris NSE component
dim nse
set nse = WScript.CreateObject ("Altiris.AeXNSEvent")

' Set the header data of the NSE
' Please don't modify this GUID
nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"
nse.Priority = 1

'Create Inventory data block.
dim objDCInstance
set objDCInstance = nse.AddDataClass (myDataClass)

dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)

'Add a new row
dim objDataRow
set objDataRow = objDataClass.AddRow

Dim filesys, sapfile, modifieddate
Set filesys = CreateObject("Scripting.FileSystemObject")
Set sapfile = filesys.GetFile("C:\Windows\saplogon.ini")
modifieddate = sapfile.DateLastModified
wscript.echo modifieddate

'Set columns
'wscript.echo "objDataRow.SetField "& i &"," & strValue

objDataRow.SetField 0, CStr(modifieddate)


3. Policy

3.1 Create a Policy to do the Custom Inventory with a Schedule that you like