svdbusse / IntuneScripts

14 stars 12 forks source link

Failure when no Primary User is set #6

Open JerichoJones opened 2 years ago

JerichoJones commented 2 years ago

No Intune Primary User Id set for Intune Managed Device Response content: {"error":{"code":"BadRequest","message":"{\r\n \"_version\": 3,\r\n \"Message\": \"User id must be in the form of Guid, User id =

The GUID appears to be many guids concatenated together separated by %20

ERROR: Set-IntuneDevicePrimaryUser : Request to https://graph.microsoft.com/beta/deviceManagement/managedDevices('GUID')/users/$ref ERROR: failed with HTTP Status BadRequest Bad Request

JerichoJones commented 2 years ago

I think this is happening because we have some devices where the LastLoggedOn field is empty in Intune.

wisper1977 commented 2 years ago

I am having the same issue, would there be a way to tell it to set a specific user in this instance?