Open CmckeeverNova opened 5 months ago
From investigating it further it seems that the serialisation for ManagedDevice and AuditEvent in device managament isnt completed to include all the fields
@CmckeeverNova would you mind sharing the version of the sdk you are using and some of the missing fields. In the meantime you should be able to access the fields in field 'device.GetAdditionalData()'
Im using v1.39.0
The only fields I get from any ManagedDevice are: id, complianceState, deviceEnrollmentType, deviceRegistrationState, exchangeAccessState, exchangeAccessStateReason, managedDeviceName, managedDeviceOwnerType, managementAgent, partnerReportedThreatState.
Every other field is missing from the result of Serialize()
@CmckeeverNova Are you able to access the fields using device.GetAdditionalData()
@rkodev GetAdditionalData returns nothing back
Are there any updates to this or changes made recently?
I just bumped into this issue in the newest version i.e. v.1.46.0. I hope it can be resolved soon. For now, this is the only resource I found to have this error.
@kwapik could you Graph Explorer to execute the same get command and share the response you receive.
@rkodev sorry for the late reply, I just missed your comment.
Actually, I don't have any tenant with real data to test on. I did test this on a HTTP server which fakes EntraID API responses and I only had issues with Managed Devices.
When I get the list of maganed devices using the sdk i can see all the info there and once I serialize it using the built in function it loses most of the data, seemingly cutting off everytime at:
"partnerReportedThreatState":"unknown"
This is how it is being serialized:
case *models.ManagedDevice: err = graphModel.Serialize(writer) if err != nil { return }
Using:
result, err := client.DeviceManagement().ManagedDevices().Get(ctx.Context, nil)
and doing a page iterator for each device:
pageIterator, err := msgraphcore.NewPageIterator[*models.ManagedDevice](result, client.GetAdapter(), models.CreateManagedDeviceCollectionResponseFromDiscriminatorValue) if err != nil { return } err = pageIterator.Iterate(ctx.Context, func(device *models.ManagedDevice) bool {