Connected Pn P Types
Query
DeviceEvents
| where ActionType == "PnpDeviceConnected"
| extend PNPInfo = parse_json(AdditionalFields)
| extend ClassName = tostring(PNPInfo.ClassName), DeviceDescription = tostring(PNPInfo.DeviceDescription), VendorIds = tostring(PNPInfo.VendorIds), DeviceId = tostring(PNPInfo.DeviceId)
| extend PnPType = tostring(split(DeviceId, @"\", 0)[0])
| summarize Total = count() by PnPType
| sort by TotalAbout this query
Connected PnP types
Query Information
Description
List the different Plug and Play (PnP) device types that are used in your organisation. The results are sorted by the total ammount of events seen for each type.
References
Defender XDR
Sentinel
DeviceEvents
| where ActionType == "PnpDeviceConnected"
| extend PNPInfo = parse_json(AdditionalFields)
| extend ClassName = tostring(PNPInfo.ClassName), DeviceDescription = tostring(PNPInfo.DeviceDescription), VendorIds = tostring(PNPInfo.VendorIds), DeviceId = tostring(PNPInfo.DeviceId)
| extend PnPType = tostring(split(DeviceId, @"\", 0)[0])
| summarize Total = count() by PnPType
| sort by Total
Explanation
This query is designed to identify and list the different types of Plug and Play (PnP) devices that have been connected within an organization. It focuses on counting how often each type of device is connected, and then sorts these types based on the total number of connection events recorded for each type.
Here's a step-by-step breakdown of what the query does:
-
Filter Events: It starts by filtering the
DeviceEventstable to only include events where the action type is "PnpDeviceConnected". This means it only looks at events where a PnP device was connected. -
Extract Information: It then extracts additional information from the
AdditionalFieldscolumn by parsing it as JSON. This includes details like the class name, device description, vendor IDs, and device ID. -
Identify PnP Type: From the
DeviceId, it extracts the PnP type by splitting the string at the backslash (\) and taking the first part. This helps in categorizing the devices by type. -
Count Events: It summarizes the data by counting the total number of connection events for each PnP type.
-
Sort Results: Finally, it sorts the results by the total number of events, allowing you to see which PnP device types are most frequently connected in the organization.
This query is useful for understanding the variety and frequency of PnP devices being used, which can be important for inventory management, security monitoring, and resource planning.
Details

Bert-Jan Pals
Released: October 20, 2024
Tables
Keywords
Operators