Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize Intune policy assignments #4247

Merged
merged 6 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

* AADConditionalAccessPolicy
* Improved verbose logging to show that items are being skipped.
* MISC
* M365DSCDRGUtil
Add new parameter for customizable assignment identifier

# 1.24.221.1

Expand Down
12 changes: 9 additions & 3 deletions Modules/Microsoft365DSC/Modules/M365DSCDRGUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,11 @@ function Update-DeviceConfigurationPolicyAssignment
[Parameter()]
[ValidateSet('v1.0','beta')]
[System.String]
$APIVersion = 'beta'
$APIVersion = 'beta',

[Parameter()]
[System.String]
$RootIdentifier = 'assignments'
)

try
Expand Down Expand Up @@ -1331,8 +1335,10 @@ function Update-DeviceConfigurationPolicyAssignment
}
$deviceManagementPolicyAssignments += @{'target' = $formattedTarget}
}
$body = @{'assignments' = $deviceManagementPolicyAssignments} | ConvertTo-Json -Depth 20
write-verbose -Message $body

$body = @{$RootIdentifier = $deviceManagementPolicyAssignments} | ConvertTo-Json -Depth 20
Write-Verbose -Message $body

Invoke-MgGraphRequest -Method POST -Uri $Uri -Body $body -ErrorAction Stop
}
catch
Expand Down
Loading