Skip to content

Commit 495a545

Browse files
committed
feat(mem): add managed app policy support
Include Intune managed app protection policies in the policy listing endpoint and map them to the compare endpoint. The list output now classifies iOS, Android, and Windows app protection policies so they appear with clearer policy type names.
1 parent 61f6995 commit 495a545

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/Endpoint/MEM/Invoke-ExecCompareIntunePolicy.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function Invoke-ExecCompareIntunePolicy {
2222
'windowsQualityUpdatePolicies' = 'windowsQualityUpdatePolicies'
2323
'windowsQualityUpdateProfiles' = 'windowsQualityUpdateProfiles'
2424
'Intents' = 'Intents'
25+
'ManagedAppPolicies' = 'AppProtection'
2526
}
2627

2728
try {

Modules/CIPPHTTP/Public/Entrypoints/HTTP Functions/Endpoint/MEM/Invoke-ListIntunePolicy.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ function Invoke-ListIntunePolicy {
225225
method = 'GET'
226226
url = "/deviceManagement/intents?`$top=1000"
227227
}
228+
@{
229+
id = 'ManagedAppPolicies'
230+
method = 'GET'
231+
url = '/deviceAppManagement/managedAppPolicies?$orderby=displayName'
232+
}
228233
)
229234

230235
$BulkResults = New-GraphBulkRequest -Requests $BulkRequests -tenantid $TenantFilter
@@ -236,6 +241,7 @@ function Invoke-ListIntunePolicy {
236241
$URLName = $_.Id
237242
$_.body.Value | ForEach-Object {
238243
$AssignmentContext = $_.'assignments@odata.context'
244+
$PolicyODataType = $_.'@odata.type'
239245
$policyTypeName = switch -Wildcard ($AssignmentContext) {
240246
'*microsoft.graph.windowsIdentityProtectionConfiguration*' { 'Identity Protection' }
241247
'*microsoft.graph.windows10EndpointProtectionConfiguration*' { 'Endpoint Protection' }
@@ -264,6 +270,14 @@ function Invoke-ListIntunePolicy {
264270
$policyTypeName = switch ($URLName) {
265271
'deviceCompliancePolicies' { 'Compliance Policy' }
266272
'Intents' { 'Endpoint Security' }
273+
'ManagedAppPolicies' {
274+
switch -Wildcard ($PolicyODataType) {
275+
'*iosManagedAppProtection*' { 'iOS App Protection' }
276+
'*androidManagedAppProtection*' { 'Android App Protection' }
277+
'*windowsManagedAppProtection*' { 'Windows App Protection' }
278+
default { 'App Protection' }
279+
}
280+
}
267281
default { $AssignmentContext }
268282
}
269283
}

0 commit comments

Comments
 (0)