Graph API, Intune Config Policies

Sean Patten 25 Reputation points
2023-03-14T19:37:33.6666667+00:00

Hi, I am looking for some help with the Microsoft Graph API for Intune.

I am calling this API to get the device configuration policy states and this API does not appear to be returning them all, or do I need to call another API to get the full results?

https://graph.microsoft.com/beta/deviceManagement/managedDevices/$device->id/deviceConfigurationStates?$select=displayName,state

This is the result:


{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceManagement/managedDevices('')/deviceConfigurationStates(displayName,state)",
    "value": [
        {
            "displayName": "Intune data collection policy",
            "state": "compliant"
        },
        {
            "displayName": "Office Wifi",
            "state": "compliant"
        },
        {
            "displayName": "Win11Testing",
            "state": "compliant"
        },
        {
            "displayName": "Bitlocker + Firewall",
            "state": "compliant"
        },
        {
            "displayName": "MacOS - Security",
            "state": "unknown"
        }
    ]
}
        {
            "displayName": "Intune data collection policy"
        },
        {
            "displayName": "Office Wifi"
        },
        {
            "displayName": "Win11Testing"
        },
        {
            "displayName": "Bitlocker + Firewall"
        },
        {
            "displayName": "MacOS - Sec

Here is a screenshot of Intune portal, for the same DeviceId, We seem to be missing a few configuration policies.User's image

Any ideas how to get a list of them all, and their states, using the API?

Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,225 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Crystal-MSFT 49,436 Reputation points Microsoft Vendor
    2023-03-15T02:54:29.1+00:00

    @Sean Patten, Thansk for posting in Q&A.

    For different type of device configuration, it use different API. We can find the different API in the following script:

    Settings Catalog

    https://github.com/microsoftgraph/powershell-intune-samples/blob/master/SettingsCatalog/SettingsCatalog_Get.ps1

    EndpointSecurityPolicy

    https://github.com/microsoftgraph/powershell-intune-samples/blob/master/EndpointSecurity/EndpointSecurityPolicy_Get.ps1

    DeviceConfiguration

    https://github.com/microsoftgraph/powershell-intune-samples/blob/master/DeviceConfiguration/DeviceConfiguration_Get.ps1

    Hope it can help.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.