Import enrollment devices via Graph API
To import devices directly via Graph API you can send a body to an API endpoint that contains the serial number and the hardware identifier.
DokumentationUse case
To make an automation which imports devices automatically into Intune enrollment devices you can create an Azure Function that will then import the device id automatically to Intune without any user interaction or permission management. This action will be performed in the context of an app registration.
PowerShell script
This
{
"@odata.type": "#microsoft.graph.importedWindowsAutopilotDeviceIdentity",
"groupTag": "<yourgrouptag>",
"serialNumber": "<yourserialnumber>",
"hardwareIdentifier": "<yourcomputershashid>",
}
Corresponding Microsoft documentation
Create importedWindowsAutopilotDeviceIdentity - Microsoft Graph v1.0 | Microsoft Learn