Automatically populate Device-Type property (customproperty4) from system properties

Avatar
  • Pending Review

Currently we are using the "Dynamic Custom Property" extension to populate the "Device-Type" property (CustomProperty4) using the DMI/CIM SystemEnclosure ChassisType property on Windows and Linux and the Model Name property from MacOS system_profiler.

Since the extension is under Review and the old version causes excessive command logs I suggest a way to populate this specific pre-named field w/o an extension.

The MacOS and Linux scripts are quite simple:

Linux:

/usr/sbin/dmidecode -s chassis-type


Macos:

/usr/sbin/system_profiler SPHardwareDataType | awk '/Model Name: / { sub(/.*: /,""); print $0 }'

The windows script needs to decode the DMI chassis-type property by means of a pre-populated array:

$ChassisTypes=@( "", "Other", "Unknown", "Desktop", "Low Profile Desktop", "Pizza Box", "Mini Tower", "Tower", "Portable", "Laptop", "Notebook", "Hand Held", "Docking Station", "All in One", "Sub Notebook", "Space-Saving", "Lunch Box", "Main System Chassis", "Expansion Chassis", "SubChassis", "Bus Expansion Chassis", "Peripheral Chassis", "Storage Chassis", "Rack Mount Chassis", "Sealed-Case PC", "Multi-System Chassis", "Compact PCI", "Advanced TCA", "Blade", "Blade Enclosure", "Tablet", "Convertible", "Detachable", "IoT Gateway", "Embedded PC", "Mini PC","Stick PC" )

$ChassisTypes[(Get-CimInstance -class Win32_SystemEnclosure).ChassisTypes]

It would be nice to have screenconnect automatically populate this field based on the platform information.
*Note: Apple does not provide a way to access the standard SMBIOS/DMI hardware properties w/o extra software and only offers their own model name type property. A mapping to DMI values can be scripted if needed.