I am trying to get a list of all volumes drive letters from fixed disks on a system using the query:
DriveList = SELECT DeviceID
FROM wmi(query="SELECT * from Win32_LogicalDisk",
namespace="ROOT\\CIMV2")
WHERE DriveType = 3
I would like to pass to values to the "Device" variable in the Windows.KapeFiles.Targets artifact that should take the form "C:, D:" so that it collects artifacts from all fixed drive drive letters and is populated on the fly when the artifact is run from an offline collector.
DeviceID gives me the value for the volume, but when I try to reference it, it shows the full JSON output for DeviceID (IE. [{"DeviceID":"C:"}]) rather than just the value itself. I also need help with once the value can be extracted from the JSON, how to chain multiple row return values into the necessary form "C:, D:" etc.
Any help is appreciated.