Closed FNHagen closed 1 week ago
Thanks @FNHagen
Can you confirm if you use the latest version (2.4.0)?
Which option is this specifically that you use?
Yes, 2.4.0 - and goes for all options that retrieves from setting catalog Ran the 4 - Show All Policies and Their Assignments
the challenge is that not all policies are returned when calling "Invoke-MgGraphRequest -Uri $settingsCatalogUri -Method Get". You get a subset, in our case 25, and a link to the next blob. Not an expert, but think the script will need to detect that there is more data, and repeat the calls until the is no more @odata.nextlink in the returned result
Yea looks like the @odata.nextlink is missing. I will have a look.
Seems like this is working for us for the settings catalog part that is.
# Fetch settings catalog policies
$settingsCatalogUri = "https://graph.microsoft.com/beta/deviceManagement/configurationPolicies"
$tempResponse = Invoke-MgGraphRequest -Uri $settingsCatalogUri -Method Get
$response += $tempResponse
if ($tempResponse.'@odata.nextlink') {
do {
$tempResponse = Invoke-MgGraphRequest -Uri $tempResponse.'@odata.nextlink' -Method Get
$response += $tempResponse
} until (
!$tempResponse.'@odata.nextlink'
)
}
I double checked the pagination. There is one missing in a function that I have fixed now.
Can you try it with that one?
Looks better - I got 103 Settings Catalog - need some time to verify the rest (y)
Awesome. I will merge it to main. Keep the feedback coming if you need any new features or things are not working.
Thanks for taking the time to create this issue.
Best Ugur
Thanks this is a very nice tool and very useful. However it looks like we don't get all the results we expect. Is there a limitation on retrieving the data? Seems like it might be related to Settings catalog - we only get around 23 of 100+ policies
@odata.context": "https://graph.microsoft.com/beta/$metadata#deviceManagement/configurationPolicies", "@odata.count": 25, "@odata.nextLink": "https://graph.microsoft.com/beta/deviceManagement/configurationPolicies? $skiptoken=%255Bcosmosdb%255D%255B%257B%2522compositeTokenxxxxxxxxxxxxxxxxxxx", "@microsoft.graph.tips": "This request only returns a subset of the resource's properties. Your app will need to use $select to return non-default properties. To find out what other properties are available for this resource see [https://learn.microsoft.com/graph/api/resources/deviceManagementConfigurationPolicy"]