Skip to content

Commit c91f25c

Browse files
fix list intune policy urlname
1 parent 05f8d89 commit c91f25c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Modules/CIPPCore/Public/Entrypoints/Invoke-ListIntunePolicy.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Function Invoke-ListIntunePolicy {
2424
if ($ID) {
2525
$GraphRequest = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/deviceManagement/$($urlname)('$ID')" -tenantid $tenantfilter
2626
} else {
27-
$Groups = New-GraphGetRequest -uri 'https://graph.microsoft.com/beta/groups' -tenantid $tenantfilter | Select-Object -Property id, displayName
27+
$Groups = New-GraphGetRequest -uri 'https://graph.microsoft.com/beta/groups?$top=999' -tenantid $tenantfilter | Select-Object -Property id, displayName
2828

2929
$BulkRequests = [PSCustomObject]@(
3030
@{
@@ -57,6 +57,8 @@ Function Invoke-ListIntunePolicy {
5757
$BulkResults = New-GraphBulkRequest -Requests $BulkRequests -tenantid $TenantFilter
5858

5959
$GraphRequest = $BulkResults.body.value | ForEach-Object {
60+
$URLName = (($_).split('?') | Select-Object -First 1) -replace 'https://graph.microsoft.com/beta/deviceManagement/', ''
61+
6062
$policyTypeName = switch -Wildcard ($_.'[email protected]') {
6163
'*microsoft.graph.windowsIdentityProtectionConfiguration*' { 'Identity Protection' }
6264
'*microsoft.graph.windows10EndpointProtectionConfiguration*' { 'Endpoint Protection' }

0 commit comments

Comments
 (0)