Skip to content

Commit

Permalink
Merge pull request #4042 from ricmestre/fix4041
Browse files Browse the repository at this point in the history
IntuneEndpointDetectionAndResponsePolicyWindows10: Fix issue when trying to remove policy and set Identity to a random GUID or from another tenant
  • Loading branch information
NikCharlebois authored Dec 19, 2023
2 parents 78e74cc + 7f7edf5 commit 27b6c85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change log for Microsoft365DSC

# UNRELEASED

* IntuneEndpointDetectionAndResponsePolicyWindows10
* Fix issue when trying to remove policy and Identity is set to a random GUID
or from another tenant
FIXES [#4041](https://github.com/microsoft/Microsoft365DSC/issues/4041)

# 1.23.1213.1

* IntuneEndpointDetectionAndResponsePolicyWindows10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ function Set-TargetResource
elseif ($Ensure -eq 'Absent' -and $currentPolicy.Ensure -eq 'Present')
{
Write-Verbose -Message "Removing Endpoint Protection Policy {$($currentPolicy.DisplayName)}"
Remove-MgBetaDeviceManagementConfigurationPolicy -DeviceManagementConfigurationPolicyId $Identity
Remove-MgBetaDeviceManagementConfigurationPolicy -DeviceManagementConfigurationPolicyId $currentPolicy.Identity
}
}

Expand Down

0 comments on commit 27b6c85

Please sign in to comment.