Question Analysis
Review Windows process and PowerShell activity for commands that enumerate PnP entities through WMI. Which PowerShell cmdlet was invoked to perform this hardware inventory?
2cb4dbf2-2dca-4597-8678-4d39d207a3a5
Question ID
3/23
Models Correct
1
Valid Answer
13%
Success Rate
Reference Answer
Human-validated correct answer for this question
Get-WMIObject
Model Performance Comparison
See how different AI models performed on this question
Model | Answer | KQL Query | Status | Attempts | Time | Cost |
---|---|---|---|---|---|---|
gemini-2.5-flash-preview-04-17 | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0315 |
gpt-35-turbo | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0110 |
gpt-4-turbo-2024-04-09 | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.2316 |
gpt-4.1 | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0469 |
gpt-4.1-finetuned | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0459 |
gpt-4.1-mini | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0085 |
gpt-4.1-nano | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0019 |
gpt-4o | Invoke-AtomicTest T1057 | DeviceProcessEvents
| where InitiatingProcessFileName == "powershell.exe"
| where ProcessCommandLine contains "Get-WmiObject" or ProcessCommandLine contains "Win32_PnPEntity"
| project InitiatingProcessCommandLine, InitiatingProcessFileName, DeviceName, ProcessCreationTime | Incorrect | 1 | 7.62s | 0.0155 |
gpt-5-high | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.1831 |
gpt-5-mini-high | Get-WMIObject | let targetRegex = @"(?i)\b(Get-?WmiObject|gwmi|Get-?CimInstance|gcim|Get-?PnpDevice|Get-?PnpDeviceProperty)\b";
union isfuzzy=true
DeviceProcessEvents,
DeviceEvents,
DeviceFileEvents,
DeviceImageLoadEvents,
DeviceRegistryEvents
| extend CommandLine = coalesce(tostring(ProcessCommandLine), tostring(InitiatingProcessCommandLine), ""),
ProcFile = tolower(coalesce(tostring(FileName), tostring(InitiatingProcessFileName), tostring(ProcessVersionInfoOriginalFileName), ""))
// Focus on PowerShell processes to reduce noise
| where ProcFile contains "powershell" or ProcFile contains "pwsh"
// Require presence of PnP/WMI/CIM keywords in the command line
| where CommandLine has_any ("Win32_PnPEntity","PnPDevice","PnPEntity","PnP","Get-WmiObject","gwmi","Get-CimInstance","gcim","Get-PnpDevice","Get-PnpDeviceProperty")
// Extract the invoked cmdlet if present
| extend MatchedCmdlet = extract(targetRegex, 1, CommandLine)
| extend MatchedCmdlet = case(isnotempty(MatchedCmdlet), MatchedCmdlet,
CommandLine has "Win32_PnPEntity", "Win32_PnPEntity",
"(unknown)")
// Aggregate to answer which cmdlet(s) performed the hardware inventory
| summarize Count = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), ExampleCommand = any(CommandLine), ExampleDevice = any(DeviceName) by MatchedCmdlet
| order by LastSeen desc | Correct | 2 | 51.30s | 0.0115 |
gpt-5-mini-low | Get-WmiObject | // Find PowerShell activity enumerating PnP entities via WMI
let wmiIndicators = dynamic(["Get-WmiObject","Get-CimInstance","Win32_PnPEntity","Win32_PnPDevice","PNPEntity","Win32_PnPEntity","Win32_PnPDevice","SELECT * FROM Win32_PnPEntity","Get-CimInstance -ClassName Win32_PnPEntity"]);
// Search DeviceProcessEvents for PowerShell processes and DeviceEvents for process creations invoking PowerShell
let psProcesses = (
DeviceProcessEvents
| where ProcessCommandLine has "powershell" or ProcessCommandLine has "pwsh" or ProcessCommandLine has "PowerShell" or ProcessCommandLine has "pwsh.exe"
| where array_length(wmiIndicators) > 0
| extend cmdline_lc = tolower(ProcessCommandLine)
| where cmdline_lc has "get-wmiobject" or cmdline_lc has "get-ciminstance" or cmdline_lc has "win32_pnpentity" or cmdline_lc has "win32_pnpdevice" or cmdline_lc has "win32_pnp"
| extend InvokedCmdlet = case(
cmdline_lc has "get-wmiobject","Get-WmiObject",
cmdline_lc has "get-ciminstance","Get-CimInstance",
cmdline_lc has "gwmi","Get-WmiObject",
cmdline_lc has "gcim","Get-CimInstance",
"Other"
)
| project TimeGenerated, DeviceName, InitiatingProcessAccountName, ProcessId, ProcessCommandLine, InvokedCmdlet
);
let psFromDeviceEvents = (
DeviceEvents
| where ProcessCommandLine has "powershell" or ProcessCommandLine has "pwsh" or ProcessCommandLine has "PowerShell" or ProcessCommandLine has "pwsh.exe"
| extend cmdline_lc = tolower(ProcessCommandLine)
| where cmdline_lc has "get-wmiobject" or cmdline_lc has "get-ciminstance" or cmdline_lc has "win32_pnpentity" or cmdline_lc has "win32_pnpdevice" or cmdline_lc has "win32_pnp"
| extend InvokedCmdlet = case(
cmdline_lc has "get-wmiobject","Get-WmiObject",
cmdline_lc has "get-ciminstance","Get-CimInstance",
cmdline_lc has "gwmi","Get-WmiObject",
cmdline_lc has "gcim","Get-CimInstance",
"Other"
)
| project TimeGenerated, DeviceName, AccountName, ProcessId, ProcessCommandLine, InvokedCmdlet
);
psProcesses
| union psFromDeviceEvents
| summarize Count = count(), SampleCommandLines = make_set(ProcessCommandLine, 5) by InvokedCmdlet
| order by Count desc
| project InvokedCmdlet, Count, SampleCommandLines
| Correct | 1 | 14.12s | 0.0037 |
gpt-5-mini-medium | Get-WMIObject | let wmi_cmds_regex = @"(?i)\b(get-wmiobject|get-ciminstance|invoke-cimmethod|get-pnpdevice|get-pnpdeviceproperty|new-object\s+system.management.managementobjectsearcher|\[wmiclass\])\b";
let wmi_classes_regex = @"(?i)\b(Win32_PnPEntity|Win32_PnPDevice|Win32_USBControllerDevice|Win32_PnPAllocatedResource|Win32_PnPSignedDriver|Win32_USBHub)\b";
let proc_matches =
DeviceProcessEvents
| where (tolower(FileName) has "powershell" or tolower(InitiatingProcessFileName) has "powershell")
or ProcessCommandLine matches regex wmi_cmds_regex
or ProcessCommandLine matches regex wmi_classes_regex
| extend MatchedCmdlet = extract(wmi_cmds_regex, 1, ProcessCommandLine)
| extend MatchedClass = extract(wmi_classes_regex, 1, ProcessCommandLine)
| extend Detected = tostring(coalesce(MatchedCmdlet, MatchedClass, "Unknown"))
| project TimeGenerated, DeviceName, Account = InitiatingProcessAccountName, FileName, ProcessId, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessId, Detected;
let event_matches =
DeviceEvents
| where (tolower(FileName) has "powershell" or tolower(InitiatingProcessFileName) has "powershell")
or ProcessCommandLine matches regex wmi_cmds_regex
or ProcessCommandLine matches regex wmi_classes_regex
or tostring(AdditionalFields) matches regex wmi_cmds_regex
| extend MatchedCmdlet = extract(wmi_cmds_regex, 1, ProcessCommandLine)
| extend MatchedClass = extract(wmi_classes_regex, 1, ProcessCommandLine)
| extend MatchedInAdditional = extract(wmi_cmds_regex, 1, tostring(AdditionalFields))
| extend Detected = tostring(coalesce(MatchedCmdlet, MatchedClass, MatchedInAdditional, "Unknown"))
| project TimeGenerated, DeviceName, Account = InitiatingProcessAccountName, FileName, ProcessId, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessId, Detected;
proc_matches
| union event_matches
| where Detected != "Unknown"
| summarize Count = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), Examples = make_set(ProcessCommandLine, 5) by Detected, DeviceName, Account
| order by LastSeen desc
| take 200 | Correct | 3 | 44.80s | 0.0130 |
gpt-5-nano-high | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0079 |
gpt-5-nano-medium | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0088 |
grok-3-beta | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0914 |
grok-3-mini-beta | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0081 |
o1-high | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.9007 |
o1-low | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.7446 |
o3-high | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0979 |
o3-mini-high | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0515 |
o3-mini-low | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0442 |
o4-mini-high | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0368 |
o4-mini-low | No answer provided | No query generated | Incorrect | 5 | 0.00s | 0.0371 |