windows-itpro-docs/windows/deployment/windows-autopatch/includes/windows-autopatch-audience-graph-explorer.md
2024-08-29 20:59:11 -07:00

2.5 KiB

author, ms.author, manager, ms.service, ms.subservice, ms.topic, ms.date, ms.localizationpriority
author ms.author manager ms.service ms.subservice ms.topic ms.date ms.localizationpriority
tiaraquan tiaraquan aaroncz windows-client autopatch include 09/16/2024 medium

A deployment audience is a collection of devices that you want to deploy updates to. The audience needs to be created first, then members are added to the audience. Use the following steps to create a deployment audience, add members, and verify it:

  1. To create a new audience, POST to the deployment audience resource with a request body of {}.

    POST https://graph.microsoft.com/beta/admin/windows/updates/deploymentAudiences 
    content-type: application/json  
    
    {}
    

    The POST returns an HTTP status code of 201 Created as a response with the following body, where id is the Audience ID:

    {
        "@odata.context": "https://graph.microsoft.com/beta/$metadata#admin/windows/updates/deploymentAudiences/$entity",
        "id": "d39ad1ce-0123-4567-89ab-cdef01234567",
        "reportingDeviceCount": 0,
        "applicableContent": []
    }
    
  2. Add devices, using their Microsoft Entra ID, to the deployment audience so they become audience members. Specify the deployment Audience ID in the URL field and the devices to add in the request body. The id property specifies the Microsoft Entra ID of the device.

    POST https://graph.microsoft.com/beta/admin/windows/updates/deploymentAudiences/d39ad1ce-0123-4567-89ab-cdef01234567/updateAudience 
    content-type: application/json  
    
    {
      "addMembers": [
        {
          "@odata.type": "#microsoft.graph.windowsUpdates.azureADDevice",
          "id": "01234567-89ab-cdef-0123-456789abcdef"
        },
        {
          "@odata.type": "#microsoft.graph.windowsUpdates.azureADDevice",
          "id": "01234567-89ab-cdef-0123-456789abcde0"
        },
        {
          "@odata.type": "#microsoft.graph.windowsUpdates.azureADDevice",
         "id": "01234567-89ab-cdef-0123-456789abcde1"
        }
      ]
    }
    
  3. To verify the devices were added to the audience, run the following query using the Audience ID of d39ad1ce-0123-4567-89ab-cdef01234567:

    GET https://graph.microsoft.com/beta/admin/windows/updates/deploymentAudiences/d39ad1ce-0123-4567-89ab-cdef01234567/members