Loading...

MS Graph and Intune - A quick way to find the Graph equivalent from the Intune portal

In this post I will show you a quick way to find the resource graph equivalent to an action from the Intune portal


Context

See below what to we want:

- Execute an action from the Intune portal (change ame, action on device...)

- Automate this action

- Use Graph to do this

- Find the Graph equivalent of the Intune portal action  

 

The solution

In this solution, we will proceed as below:

1. Go to the Intune portal

2. Open the Developer mode with F12

3. Run the specific action from the Intune portal

4. Stop recording network log button in developer mode

5. Check the debeloper mode Network tab

6. Access to the Graph URL use for this action


Solution in action

We will try to find the appropriate Graph URL path for the below things:

- List all devices

- Change device name

- Action restart device

- List Group Policy details


List all devices

1. Go to Devices

2. Open the developer mode with F12

3. Go to the Network tab

4. Go to All devices

5. Click on the Stop recording network log

6. On the developer mode, the resource is displayed

7. Here it's managedDevices

8. Click on it

9. The resource path to use is displayed

10. The method to use is GET

11. A right-click on the resource allows you to copy it as PowerShell.



Change device name

1. Go to Devices

2. Go to All devices

3. Select a device

4. Open the developer mode with F12

5. Go to the Network tab

6. Click on the ...

7. Click on Rename device

8. Type a new name like POSTE-TEST

9. Click on Rename

10. Click on the Stop recording network log

11. On the developer mode, the resource is displayed

12. Here it's setDeviceName

13. Click on it

14. The resource path to use is displayed

15. The method to use is POST

16. Go at the bottom of the Network tab

17. Go to the Request Payload part

18. We have the below JSON payload:

19. This one will be used to rename the device

20. We will need it in JSON format to rename a device


Action restart device

1. Go to Devices

2. Go to All devices

3. select a device

4. Open the developer mode with F12

5. Go to the Network tab

6. Click on the ...

7. Click on Restart

8. Click on the Stop recording network log

9. On the developer mode, the resource is displayed

10. Here it's rebootNow

11. Click on it

12. The resource path to use is displayed

13. The method to use is POST


List Group Policy details

1. Go to Devices

2. Go to Group Policy analytics

3. Open the developer mode with F12

4. Go to the Network tab

5. Click on a report

6. Click on the Stop recording network log 

7. On the developer mode, the resource is displayed

8. Here it's groupPolicyMigrationReports

9. Click on it

10. The resource path to use is displayed

11. The method to use is mentioned and is GET

slider 7647593231950050137

Publier un commentaire

Accueil item

Award

Endpoint Manager award

Mes articles en français

Author of Books

PowerShell GUI & WPF Group

PowerShell GUI & WPF Group

Join the FPSUGR

Join the FPSUGR

Stats