Share via

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 Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
Developer technologies | C#
Developer technologies | 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.

{count} votes

Answer accepted by question author
  1. Shweta Mathur 30,456 Reputation points Microsoft Employee Moderator
    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.