feature: collect MDM Hardware Data (Autopilot hash) during device enrolment

resolves #160
This commit is contained in:
Gary Sharp
2025-02-05 17:38:57 +11:00
parent 0853bcee50
commit f946f3250c
17 changed files with 599 additions and 422 deletions
+13
View File
@@ -46,6 +46,7 @@ namespace Disco.Client.Interop
audit.ApplyPhysicalMemoryInformation();
audit.ApplyDiskDriveInformation();
audit.ApplyBatteryInformation();
audit.ApplyMobileDeviceManagementInformation();
audit.NetworkAdapters = Network.GetNetworkAdapters();
@@ -560,6 +561,18 @@ namespace Disco.Client.Interop
}
}
private static void ApplyMobileDeviceManagementInformation(this DeviceHardware deviceHardware)
{
try
{
using (var wmiObject = new ManagementObject(@"\\.\ROOT\CIMV2\mdm\dmmap:MDM_DevDetail_Ext01.InstanceID=""Ext"",ParentID=""./DevDetail"""))
{
deviceHardware.MdmHardwareData = (string)wmiObject.GetPropertyValue("DeviceHardwareData");
}
}
catch (Exception) { }
}
private static string Description(this PCSystemTypes type)
{
switch (type)