# mv-expand

### 🚕 Windows Hello for Business

````
AuditLogs
| where TimeGenerated > ago (30d)
| where OperationName contains "Windows Hello for Business"
| mv-expand TargetResources
| extend modifiedProperties = TargetResources.modifiedProperties
| mv-expand modifiedProperties
| evaluate bag_unpack(modifiedProperties)
| mv-expand todynamic(newValue)
| extend creationTime = todatetime(replace_string(tostring(newValue.creationTime), " +00:00", ""))
| extend deviceId = tostring(newValue.deviceId)
| extend UserId = tostring(parse_json(tostring(InitiatedBy.user)).id)
| extend userPrincipalName = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)
| summarize arg_max(creationTime, *) by UserId, deviceId
| project TimeGenerated, creationTime, userPrincipalName, UserId, deviceId, ActivityDisplayName
| join kind=inner (SigninLogs
    | extend deviceId = tostring(DeviceDetail.deviceId)
    | extend deviceName = tostring(DeviceDetail.displayName)
    | where isnotempty(deviceName)
    | extend trustType = tostring(DeviceDetail.trustType)
    | summarize arg_max(TimeGenerated, *) by deviceId
    | distinct deviceId, deviceName, trustType
    ) on $left.deviceId == $right.deviceId
| project  WHfBcreationTime = creationTime, userPrincipalName, UserId, deviceName, AADdeviceId = deviceId
```
````

![](/files/bmBJk3VMrebHmgrGude8)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sandyzeng.gitbook.io/kql/kql-quick-guide/my-favorites/mv-expand.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
