microsoft / Intune-PowerShell-SDK

Native PowerShell support for invoking Microsoft Intune Graph API to enable IT Pro scenario automation.
MIT License
314 stars 77 forks source link

get-devicemanagement_devicecompliancepolicysettingstatesummaries returns Setting Name as Setting and ID #81

Closed read-0nly closed 4 years ago

read-0nly commented 4 years ago

This is what the command returns with no parameters:

id                       : DefaultDeviceCompliancePolicy.RequireDeviceCompliancePolicyAssigned
setting                  : DefaultDeviceCompliancePolicy.RequireDeviceCompliancePolicyAssigned
settingName              : DefaultDeviceCompliancePolicy.RequireDeviceCompliancePolicyAssigned
platformType             : all
unknownDeviceCount       : 0
notApplicableDeviceCount : 0
compliantDeviceCount     : 7
remediatedDeviceCount    : 0
nonCompliantDeviceCount  : 0
errorDeviceCount         : 0
conflictDeviceCount      : 0

The response section of the docs says the ID should be a UID: https://docs.microsoft.com/en-us/graph/api/intune-deviceconfig-devicecompliancepolicysettingstatesummary-get?view=graph-rest-1.0#response-1

{
  "value": {
    "@odata.type": "#microsoft.graph.deviceCompliancePolicySettingStateSummary",
    "id": "7474d6d5-d6d5-7474-d5d6-7474d5d67474",
    "setting": "Setting value",
    "settingName": "Setting Name value",
    "platformType": "iOS",
    "unknownDeviceCount": 2,
    "notApplicableDeviceCount": 8,
    "compliantDeviceCount": 4,
    "remediatedDeviceCount": 5,
    "nonCompliantDeviceCount": 7,
    "errorDeviceCount": 0,
    "conflictDeviceCount": 3
  }
}
read-0nly commented 4 years ago

Oh fun. Graph Explorer returns the same. The value returned for ID doesn't work appended to the url either.

        {
            "id": "DefaultDeviceCompliancePolicy.RequireDeviceCompliancePolicyAssigned",
            "setting": "DefaultDeviceCompliancePolicy.RequireDeviceCompliancePolicyAssigned",
            "settingName": "DefaultDeviceCompliancePolicy.RequireDeviceCompliancePolicyAssigned",
            "platformType": "all",
            "unknownDeviceCount": 0,
            "notApplicableDeviceCount": 0,
            "compliantDeviceCount": 7,
            "remediatedDeviceCount": 0,
            "nonCompliantDeviceCount": 0,
            "errorDeviceCount": 0,
            "conflictDeviceCount": 0
        },

https://graph.microsoft.com/beta/deviceManagement/deviceCompliancePolicySettingStateSummaries/DefaultDeviceCompliancePolicy.RequireDeviceCompliancePolicyAssigned and https://graph.microsoft.com/v1.0/deviceManagement/deviceCompliancePolicySettingStateSummaries/DefaultDeviceCompliancePolicy.RequireDeviceCompliancePolicyAssigned both fail, suggesting that's not the ID that should be provided - is Graph itself broken then?