IntuneSettingCatalogCustomPolicyWindows10 : Bug: It duplicates the existing policy instead of just updating it. #5088
Description
Description of the issue
Resource : IntuneSettingCatalogCustomPolicyWindows10
Error : It duplicates the existing policy instead of updating it. Based on our investigation, the query Get-MgBetaDeviceManagementConfigurationPolicy only shows the first 25 policies. If the policy you’re updating is not found in the query, the system will create it, assuming the policy does not exist.”
Microsoft 365 DSC Version
1.24.904.1
Which workloads are affected
Intune
The DSC configuration
IntuneSettingCatalogCustomPolicyWindows10 "IntuneSettingCatalogCustomPolicyWindows10-AllUSB26"
{
Assignments = @(
MSFT_DeviceManagementConfigurationPolicyAssignments{
deviceAndAppManagementAssignmentFilterType = 'none'
groupDisplayName = 'IntuneGroup'
dataType = '#microsoft.graph.groupAssignmentTarget'
groupId = '40855b83-24ad-41b5-86c2-xxxxxxxxxx'
}
);
Credential = $Credscredential;
Description = "";
Ensure = "Present";
Id = "e6bb385e-4cc4-4733-a7be-xxxxxxxxxx";
Name = "AllUSB26";
Platforms = "windows10";
Settings = @(
MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
Value = 'device_vendor_msft_defender_configuration_disablecputhrottleonidlescans_0'
}
SettingDefinitionId = 'device_vendor_msft_defender_configuration_disablecputhrottleonidlescans'
odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
}
}
MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
Value = 'device_vendor_msft_defender_configuration_hideexclusionsfromlocaladmins_1'
}
SettingDefinitionId = 'device_vendor_msft_defender_configuration_hideexclusionsfromlocaladmins'
odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
}
}
MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
Value = 'device_vendor_msft_policy_config_deviceguard_lsacfgflags_2'
}
SettingDefinitionId = 'device_vendor_msft_policy_config_deviceguard_lsacfgflags'
odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
}
}
MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
Value = 'device_vendor_msft_policy_config_deviceguard_enablevirtualizationbasedsecurity_1'
}
SettingDefinitionId = 'device_vendor_msft_policy_config_deviceguard_enablevirtualizationbasedsecurity'
odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
}
}
MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
Value = 'device_vendor_msft_policy_config_microsoft_edgev122~policy~microsoft_edge_enhancesecuritymodeallowuserbypass_0'
}
SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edgev122~policy~microsoft_edge_enhancesecuritymodeallowuserbypass'
odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
}
}
MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
Value = 'device_vendor_msft_policy_config_microsoft_edgev121~policy~microsoft_edge~typosquattingchecker_preventtyposquattingpromptoverride_1'
}
SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edgev121~policy~microsoft_edge~typosquattingchecker_preventtyposquattingpromptoverride'
odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
}
}
MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
Value = 'device_vendor_msft_policy_config_microsoft_edgev96~policy~microsoft_edge_rendererappcontainerenabled_1'
}
SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edgev96~policy~microsoft_edge_rendererappcontainerenabled'
odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
}
}
MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
Children = @(
MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
Value = 'device_vendor_msft_policy_config_microsoft_edgev98.1~policy~microsoft_edge_enhancesecuritymode_enhancesecuritymode_2'
}
SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edgev98.1~policy~microsoft_edge_enhancesecuritymode_enhancesecuritymode'
odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
}
)
Value = 'device_vendor_msft_policy_config_microsoft_edgev98.1~policy~microsoft_edge_enhancesecuritymode_1'
}
SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edgev98.1~policy~microsoft_edge_enhancesecuritymode'
odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
}
}
);
Technologies = "mdm";
}
}
}
Verbose logs showing the problem
VERBOSE: [myVM]: [[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-[AllUSB26] Could not
find an Intune Setting Catalog Custom Policy for Windows10 with Name {AllUSB26}
VERBOSE: [myVM]: [[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-[AllUSB26]
Test-TargetResource returned False
VERBOSE: [myVM]: LCM: [ End Test ] [[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-[AllUSB26] in 2.1630
seconds.
VERBOSE: [myVM]: LCM: [ Start Set ] [[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-[AllUSB26]
VERBOSE: [myVM]: [[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-[AllUSB26] Could not
find an Intune Setting Catalog Custom Policy for Windows10 with Id {c45e6e22-43cc-4040-a151-6099dc6e2c61}
VERBOSE: [myVM]: [[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-[AllUSB26] Could not
find an Intune Setting Catalog Custom Policy for Windows10 with Name {AllUSB26}
VERBOSE: [myVM]: [[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-[AllUSB26] Creating an
Intune Setting Catalog Custom Policy for Windows10 with Name {}
VERBOSE: [myVM]: LCM: [ End Set ] [[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-[AllUSB26] in 4.9830
seconds.
VERBOSE: [myVM]: LCM: [ End Resource ] [[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-[AllUSB26]
WARNING: Falling back to the previous MOF file or system defaults because the meta configuration mof does not exist or has either been corrupted or an
invalid mof property has been set.
VERBOSE: [myVM]: LCM: [ End Set ]
VERBOSE: [myVM]: LCM: [ End Set ] in 111.2360 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 112.621 seconds
Environment Information + PowerShell Version
OsName : Microsoft Windows 11 Enterprise
OsOperatingSystemSKU : EnterpriseEdition
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 22621.1.amd64fre.ni_release.220506-1250
OsLanguage : en-US
OsMuiLanguages : {en-US}
Key : PSVersion
Value : 5.1.22621.4111
Name : PSVersion
Key : PSEdition
Value : Desktop
Name : PSEdition
Key : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0...}
Name : PSCompatibleVersions
Key : BuildVersion
Value : 10.0.22621.4111
Name : BuildVersion
Key : CLRVersion
Value : 4.0.30319.42000
Name : CLRVersion
Key : WSManStackVersion
Value : 3.0
Name : WSManStackVersion
Key : PSRemotingProtocolVersion
Value : 2.3
Name : PSRemotingProtocolVersion
Key : SerializationVersion
Value : 1.1.0.1
Name : SerializationVersion
Metadata
Assignees
Labels
No labels
Activity