How To Detect and Report Fonts with Custom Inventory
book
Article ID: 178598
calendar_today
Updated On:
Products
Inventory SolutionClient Management SuiteIT Management SuiteServer Management SuiteAsset Management Suite
Issue/Introduction
The custom inventory script presented in this article detects font files on Windows computers in the C:\Windows\Fonts folder and reports the font names to a custom data class in the Altiris database. Follow the instructions below to set up the custom data class, custom inventory task, and custom report to display the data. Please note that Symantec Support does not support custom scripting or reporting so modifications to the script and report must be made by the user.
Resolution
Create a new custom data class that will store the font information for each computer.
Go to Settings>All Settings then Settings>Discovery and Inventory>Inventory Solution>Manage Custom Data Classes.
Click New data class.
Name the data class "Font" and click OK.
Click Add attribute.
Name the attribute "Font Title", set Key to "No", and click OK.
Enable Allow multiple rows from a single computer resource.
Click Save Changes.
Create a Custom Inventory Script Task.
Go to Manage>Jobs and Tasks.
Browse the folder drop-down menu to where you would like to add a custom inventory script task.
Right-click on the folder, then select New>Task.
Select the Run Script task.
Name the task appropriately.
Select Script type: VBScript.
Copy and paste the entire vbscript below into the large text box of the script task.
'******************************************************* 'This Custom Inventory vbscript loops through font files to report their titles '*******************************************************
set objFSO = CreateObject("Scripting.FileSystemObject")
'Create the NSE 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. The following data class with below guid is already configured on server. 'Brackets are required around the data class guid. To get this GUID, click on the custom data class and then the hand (details). dim objDCInstance set objDCInstance = nse.AddDataClass ("Font") '***your custom data class name here ' or "{GUID of CUSTOM DATA CLASS include brackets}" dim objDataClass set objDataClass = nse.AddDataBlock (objDCInstance) dim objDataRow set objShell = CreateObject("Shell.Application") set objFolder = objShell.Namespace("C:\Windows\Fonts\")
'Loop through each font file and get its Title property (not the file name) For Each objFile In objFolder.Items set objDataRow = objDataClass.AddRow objDataRow.SetField 0, objFolder.GetDetailsOf(objFile, 0) Next
' Send the NSE data to the NS server nse.SendQueued
Run the Custom Inventory Script task
Click on New Schedule, choose Now or specify a schedule time and repeat interval.
Specify target computers to run the task on.
To target a single computer click in the Quick add: box and search for the name of the computer, or use the Quick Run feature instead of New Schedule.
To target a list of computers click on Add>Computers or Devices then manually select the desired computers and click > and OK.
To target a computer filter (such as All Computers) click on Add>Target, click Add rule, choose exclude computers not in, and search the name of the filter in the final drop-down box. then click OK
Create a Custom Report to view the data collected by the custom inventory
Go to Reports>All Reports.
Browse to a folder where you would like to add the custom report and right-click on the folder. Select New>Report>SQL Report.
Give the report an appropriate name.
Replace the text under Parameterized Query with the following query:
Select * from Inv_Font left join vComputer on vComputer.Guid = Inv_Font._ResourceGuid
Click Save Changes and then view the collected custom inventory data for each computer.