Skip to main content

Detecting the Display Model using a Custom Field

Use a FileWave Custom Field to collect the display model reported by Mac and Windows devices. This is useful when you want display information available in inventory, Smart Groups, or device lists without manually checking each computer.

Adding the Custom Field

  1. Download the Custom Field export: Display Model Custom Field.customfields.
  2. In FileWave Central, open Assistants > Custom Fields > Edit Custom Fields, select Import, and choose the downloaded file. See Import and Export Custom Field Definitions if an existing field conflicts with the import.
  3. Before saving, review the imported scripts and assignment. This download has Assigned to all devices enabled. Clear it if you want to test on selected devices first, then save the changes.
  4. Assign the Custom Field to the devices that should report display model information. You can right-click selected devices and choose Edit Custom Field(s) Associations, use a Smart Group to target the field, or enable Assigned to all devices while editing the Custom Field.

Display Model Custom Field configured as a client script

The imported field uses a client script. The Windows section uses PowerShell to read monitor information from ROOT\WMI:

$MonitorList = Get-WmiObject -Class WmiMonitorID -Namespace "ROOT\WMI"
$MonitorOutput = @()
  
foreach ($monitor in $MonitorList) {
$mon = @{}
$manufacturer = $null
$name = $null
  
foreach($ch in $monitor.ManufacturerName) {
if($ch -ne '00') {
$manufacturer += [char]$ch
}
}
  
foreach($ch in $monitor.UserFriendlyName) {
if($ch -ne '00') {
$name += [char]$ch
}
}
$mon = $manufacturer + " " + $name
$MonitorOutput += $mon
}
$MonitorOutput=$MonitorOutput -join ', '
$MonitorOutput
exit 0

The macOS section uses a shell script to read display details from system_profiler:

#!/bin/bash
DisplayModel=`system_profiler SPDisplaysDataType | grep "Resolution:" -B1 | awk -v n=3 'NR%n==1' | sed "s/^[ \t]*//" | sed 's/:/,/g' | tr '\n' ' '`
echo ${DisplayModel}
exit 0

After the field is imported and assigned, save the Custom Fields dialog and allow the FileWave Client to complete verification and send inventory. Client Script Custom Fields run after verification, before inventory is sent. Devices with more than one attached display may report multiple display models as a comma-separated value.

Results

Once inventory has updated, add the Display Model column to the Clients view and compare its value with the displays connected to a test device for each platform you intend to target before using it in Smart Group criteria. This download uses the default value Pending...; that value is not a detected display model. A blank or incomplete result is not proof that no display is attached. The Windows script reads monitor information from WMI, and the macOS script parses the text layout of system_profiler output. Check the script output on the affected platform if the inventory value does not match the connected displays.