Forum Discussion

andrius_vas's avatar
andrius_vas
Copper Contributor
Dec 11, 2024

Get-MgBetaDeviceManagementDeviceConfiguration fails

I’m trying to fetch all Intune configuration policies using Get-MgBetaDeviceManagementDeviceConfiguration (the Get-MgDeviceManagementDeviceConfiguration cmdlet is even worse), but it fails to retrieve certain policy types like Administrative Templates and Settings Catalog. How can I fetch all policy types?

  • Ankido's avatar
    Ankido
    Iron Contributor

    Hi Andrius_vas,
    Cmdlets Can Be Misleading

    In some cases, the cmdlets provided by Microsoft Graph PowerShell, such as Get-MgDeviceAppManagementMobileApp, do not retrieve all the expected results. For example, I noticed that it failed to return all the Android apps I was looking for. Similarly, Get-MgDeviceManagementDeviceConfiguration did not include all the expected device configurations.

    To work around these limitations, I created custom logic using Invoke-MgGraphRequest. While this approach requires more effort, it gives me greater control over the data retrieval process.

    Not All Policies Are the Same

    A good example of this is Device Configuration Policies. In the Intune UI, they appear unified and grouped, but in Microsoft Graph, they can represent completely different resource types. For instance, device configuration profiles may vary significantly in their backend representation within the API.

    From an administrator's perspective, they may look identical in the UI, but understanding these differences in Graph is crucial. This knowledge helps you find the right resources and ensures you're working with the correct policies when using the Graph API.

    Below is the a helpful link:

    Get All Assigned Intune Policies and Apps from a Microsoft Entra Group

Resources