How to register device on Entra ID programatically

Akesh Jadhav 20 Reputation points
2024-07-09T07:45:18.6466667+00:00

Hi ,

I want to register my local device to Entra ID using c#. I have gone through the Microsoft Graph API documentation as well but didn't get any information related to this topic please help me.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,327 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,038 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,203 questions
{count} votes

Accepted answer
  1. Shweta Mathur 29,856 Reputation points Microsoft Employee
    2024-07-10T04:53:36.5066667+00:00

    Hi @Akesh Jadhav ,

    Thanks for reaching out.

    To create and register a new device in the organization using Graph API, your app must be registered with the Microsoft identity platform and has Directory.AccessAsUser.All permissions in your registered application to register the device in Entra ID.

    To register the device, user should have Intune Administrator, or Windows 365 Administrator or higher role.

    Users need to authenticate to get the access token with required permissions/scope (Directory.AccessAsUser.All ) to call the below Graph API to register the device

    POST https://graph.microsoft.com/v1.0/devices
    Content-type: application/json
    
    {
      "accountEnabled":false,
      "alternativeSecurityIds":
      [
        {
          "type":2,
          "key":"xxx"
        }
      ],
      "deviceId":"DeviceID",
      "displayName":"DeviceName",
      "operatingSystem":"OsName",
      "operatingSystemVersion":"OsVersion"
    }
    
    
    

    Reference - https://learn.microsoft.com/en-us/graph/api/device-post-devices?view=graph-rest-1.0&tabs=http

    Hope this will help.

    Thanks,

    Shweta

    Please do not forget to "Accept the answer" to help others in the community.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.