DriveItem.CreatedBy.Device 属性 对于 OneDrive 中的文件为空

DriveItem.CreatedBy.Device property is null for files in OneDrive

我正在使用 Microsoft Graph 客户端 .Net SDK 在我的 OneDrive 中搜索文件。我正在搜索根文件夹下的所有 .docx 个文件:

IDriveItemSearchCollectionPage searchResults = await graphClient
    .Me
    .Drive
    .Root
    .Search(query)
    .Request()
    .GetAsync();

问题是我需要创建文件的设备信息,但在 Microsoft Graph 响应中 DriveItem.CreatedBy.Device 属性 始终为空。

如何检索与 DriveItem

CreatedByLastUpdatedBy 属性关联的设备信息

这可能是因为我没有向 AAD 注册任何设备吗?设备是否需要注册到 AAD 以便 Microsoft Graph 检索创建文件的设备的信息?

createdBy 属性 return 是与文件创建相关联的 microsoft.graph.identity 对象。 returned 的身份类型取决于文件的创建方式:

  • 如果 signed-in 用户 上传了文件,它将 return user 身份。
  • 如果没有 signed-in 用户的 应用程序 (即守护程序服务)创建了该文件,它将 return application 身份.
  • 如果没有 signed-in 用户的 设备 创建了文件(即 Surface Hub),它将 return device 身份.