retrieve hardware driver id / path after HardwareScan() method has been executed

Hello,

I am trying to figure out the easiest way to get the resulting driver id / path, after the HardwareScan() method has been called. I see the method returns a ServerTask instance, but when the task is complete, I cannot find any reference to the actual driver id or path.

I can see that in the SurveillanceCouldSampleService sample this is done via ConfigAPIClient, but I would like to use a simpler solution if it is possible.

Thanks in advance!

Here’s how I’m doing it in MilestonePSTools

        private string ScanForDriver(RecordingServer recorder)
        {
            var progress = new ProgressRecord(1, "Stage 1/3", "Performing hardware scan");
            var driverId = DriverId.HasValue ? DriverId.ToString() : string.Empty;
            var serverTask = recorder.HardwareScan(Address, driverId, UserName, Password, UseDefaultCredentials);
            var serverTaskExecuter = new ServerTaskProgressWriter(this, serverTask, progress);
            serverTaskExecuter.MonitorProgress();
            WriteVerbose(ServerTasks.GetTaskPropertyReport(serverTask, "HardwareScan Results"));
 
            if (serverTask.GetProperty(ServerTasks.DriverScanProperty.MacAddressExistsLocal) == true.ToString())
                throw new InvalidOperationException("MAC address already exists on recording server");
            if (serverTask.GetProperty(ServerTasks.DriverScanProperty.HardwareScanValidated) == false.ToString())
                throw new InvalidOperationException("Failed to detect driver during HardwareScan");
 
            return serverTask.GetProperty(ServerTasks.DriverScanProperty.HardwareDriverPath);
        }

The servertask property name is “HardwareDriverPath” and is a string like HardwareDriver[guid]. Sometimes you want the driver number value instead (the value you see on the Supported Hardware List) and you can get that by enumerating the drivers in the hardwaredriverfolder on the Recording Server, or by getting the config API object using that path value directly.