Desktop monitor inventory

Here’s a step by step guide how to create Altiris desktop monitor inventory report that will show all make and models, serial numbers, device hardware ID’s and size of all external monitors connected to computer.

In order to gather all that stuff we’ll use monitordetails WMI provider that will allow us to get all that additional information from the systems. This WMI provider is not included in Windows by default, it must be downloaded and distributed. Although the default desktopmonitor (Win32_desktopmonitor class) does report device PnP ID and screen resolution, it does not give a clear info about make and model.

Here’s what we need:

1. download and distribute monitordetails WMI provider. (MSI is available here)

2.  create custom data class in Altiris that will include all our output attributes

3. create custom inventory task and schedule that will use our vbs script with monitordetails WMI provider.

4.  create Altiris desktop monitors report

_________________________________________________________________________________

1. I assume you have downloaded and distributed monitordetails WMI provider (that you can get from here). Its an .msi so /quiet /norestart will do this silently in the background.

To verify if your new wmi class works, open cmd then run path Win32_monitordetails from the WMI console (type wmic to enter the console or add wmic.exe prefix for the command)

2.  Create your custom data class:

– In Altiris Console  go to  Settings -> All settings -> Discovery and Inventory -> Inventory Solution -> Manage Custom Data Classes and add new Data class. Call it “Desktop monitors”

– add the following attributes: Model, MonitorID, Name, PnPID, SerialNumber, SizeDiagInch, SiezeHorCM, SizeVerCM. Keep all data type, size, key as default.

 

3. Create custom inventory task.

In Altiris Console: Manage -> Jobs and Tasks -> Samples -> Discovery and Inventory -> Inventory Samples -> Custom

Clone Custom Inventory – Processor and create Custom Inventory – Desktop Monitors 

Make sure the script type is set to VBScript, then copy and paste the following script.

'Following is a sample custom inventory sript gathering information about processor of a machine and posting data
'to NS using Altiris NSE Component
'===================================================================================================================
'      On Error Resume Next

'Create instance of Wbem service object and connect to namespace
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

'Fire WMI Query
Set objCIMObj = objWMIService.ExecQuery("select * from win32_monitordetails")

'===================================================================================================================

'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. Here assumption is that the data class with below guid is already configured on server
dim objDCInstance
set objDCInstance = nse.AddDataClass ("Desktop Monitors")

dim objDataClass
set objDataClass = nse.AddDataBlock (objDCInstance)

For each objInfo in objCIMObj

'Add a new row
dim objDataRow
set objDataRow = objDataClass.AddRow
'Set columns
objDataRow.SetField 0, objInfo.Model
objDataRow.SetField 1, objInfo.MonitorID
objDataRow.SetField 2, objInfo.Name
objDataRow.SetField 3, objInfo.PnPID
objDataRow.SetField 4, objInfo.SerialNumber
objDataRow.SetField 5, objInfo.SizeDiagInch
objDataRow.SetField 6, objInfo.SizeHorCM
objDataRow.SetField 7, objInfo.SizeVerCM
Next

nse.SendQueued

once that done, you can either “run once” on a selected test machines or create a schedule and apply to a specific filter.

You need to run the script prior to creating report. This is because the script must gather the information from the machines first for the  custom data class attributes to appear under “Fields” in your report.

4. Create report

Altiris Console: Reports -> All Reports -> New Report -> Computer report and name it Desktop Monitors or whatever you want.

Under the Data source, select “Fields” and add the following fields:

Save changes and Run.

Report will return all your attributes specified above: