Skip to content

Commit

Permalink
Merge pull request #5254 from FabienTschanz/fix/intune-edr-win10
Browse files Browse the repository at this point in the history
Fix autofromconnector type for Intune EDR Windows10 policy
  • Loading branch information
NikCharlebois authored Oct 24, 2024
2 parents 019cbf8 + 33e217b commit eb886ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
selected
* Fixed retrieval of resource when it cannot be found by `Id`
* Added a few verbose messages
* IntuneEndpointDetectionAndResponsePolicyWindows10
* Fixes an issue with `AutoFromConnector` as the Configuration package type.
FIXES [#5246](https://github.com/microsoft/Microsoft365DSC/issues/5246)
* Intune workload
* Fixed missing permissions in settings.json
* SentinelAlertRule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,11 @@ function Get-TargetResource

$policySettings = @{}
$policySettings = Export-IntuneSettingCatalogPolicySettings -Settings $settings -ReturnHashtable $policySettings
if ($policySettings.ClientConfigurationPackageType -eq 'onboarding_fromconnector')
{
$policySettings.Add('ConfigurationType', 'AutoFromConnector')
}
else
{
$policySettings.Add('ConfigurationType', $policySettings.ClientConfigurationPackageType)
}
$policySettings.Add('ConfigurationType', $policySettings.ClientConfigurationPackageType)
$policySettings.Remove('ClientConfigurationPackageType')
$policySettings.Remove('onboarding')
$policySettings.Remove('offboarding')
$policySettings.Remove('onboarding_fromconnector')
$policySettings.Remove('autofromconnector')

# Removing TelemetryReportingFrequency because it's deprecated and doesn't need to be evaluated and enforced
$policySettings.Remove('telemetryreportingfrequency')
Expand Down Expand Up @@ -273,8 +266,8 @@ function Set-TargetResource
{
'AutoFromConnector'
{
$BoundParameters.Add('ClientConfigurationPackageType', 'onboarding_fromconnector')
$BoundParameters.Add('onboarding_fromconnector', $ConfigurationBlob)
$BoundParameters.Add('ClientConfigurationPackageType', 'autofromconnector')
$BoundParameters.Add('onboarding_fromconnector', 'autoConnectPlaceholder')
$BoundParameters.Remove('ConfigurationBlob') | Out-Null
}
'Onboard'
Expand All @@ -291,9 +284,9 @@ function Set-TargetResource
}
}

if ([System.String]::IsNullOrEmpty($ConfigurationBlob))
if ($ConfigurationType -ne 'AutoFromConnector' -and [System.String]::IsNullOrEmpty($ConfigurationBlob))
{
throw "ConfigurationBlob is required for configurationType '$($DSCParams.ConfigurationType)'"
throw "ConfigurationBlob is required for configurationType '$($ConfigurationType)'"
}
$BoundParameters.Remove('ConfigurationType') | Out-Null

Expand Down

0 comments on commit eb886ca

Please sign in to comment.