diff --git a/CHANGELOG.md b/CHANGELOG.md index f856c710e1..9088b8b25e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/MSFT_IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/MSFT_IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10.psm1 index 83ca99719a..50e03fc980 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/MSFT_IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10/MSFT_IntuneDeviceConfigurationDefenderForEndpointOnboardingPolicyWindows10.psm1 @@ -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 @@ -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