I am using Microsoft Graph Client .Net SDK to search for files in my OneDrive. I am searching for all .docx
files under the root folder:
IDriveItemSearchCollectionPage searchResults = await graphClient
.Me
.Drive
.Root
.Search(query)
.Request()
.GetAsync();
The issue is that I need the Device info that created the file but in the Microsoft Graph response the DriveItem.CreatedBy.Device
property is always null.
How can I retrieve the Device information associated with the CreatedBy
or LastUpdatedBy
properties of the DriveItem
Could this be due to the fact that I have not registered any device to AAD? Do the devices need to be registered to AAD for Microsoft Graph to retrieve the information of the device that created the file?
The createdBy
property returns the microsoft.graph.identity
object associated with the file's creation. Which type of identity is returned depends on how the file was created:
user
identity. application
identity. device
identity.