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

Fix policy creation when onboarding blob is specified and tenant is Defender for Endpoint enrolled #4627

Merged
merged 2 commits into from
May 8, 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 @@ -9,6 +9,9 @@
FIXES [#4283](https://github.com/microsoft/Microsoft365DSC/issues/4283)
* IntuneDeviceConfigurationCustomPolicyWindows10
* Fixed an issue where the payload of xml files was not encoded as base64.
* IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10
* Fixed a creation and update issue when the exported policy contains a
onboarding blob and the tenant is connected to Defender for Endpoint Service.
* M365DSCUtil
* Fixed an issue where one could not pass empty arrays to the
`Compare-PSCustomObjectArrays` function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ function Set-TargetResource

$CreateParameters = ([Hashtable]$BoundParameters).clone()
$CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters

if ($AdvancedThreatProtectionAutoPopulateOnboardingBlob -and `
$PSBoundParameters.AdvancedThreatProtectionAutoPopulateOnboardingBlob)
{
$CreateParameters.Remove('AdvancedThreatProtectionOnboardingBlob') | Out-Null
}

$CreateParameters.Remove('Id') | Out-Null

$keys = (([Hashtable]$CreateParameters).clone()).Keys
Expand Down Expand Up @@ -325,6 +332,12 @@ function Set-TargetResource
$UpdateParameters = ([Hashtable]$BoundParameters).clone()
$UpdateParameters = Rename-M365DSCCimInstanceParameter -Properties $UpdateParameters

if ($AdvancedThreatProtectionAutoPopulateOnboardingBlob -and `
$PSBoundParameters.AdvancedThreatProtectionAutoPopulateOnboardingBlob)
{
$UpdateParameters.Remove('AdvancedThreatProtectionOnboardingBlob') | Out-Null
}

$UpdateParameters.Remove('Id') | Out-Null

$keys = (([Hashtable]$UpdateParameters).clone()).Keys
Expand Down
Loading