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

IntuneAntivirusPolicyWindows10SettingCatalog: Cannot export policy #3360

Closed
DavNobrega opened this issue Jun 5, 2023 · 1 comment · Fixed by #3361 or #3370
Closed

IntuneAntivirusPolicyWindows10SettingCatalog: Cannot export policy #3360

DavNobrega opened this issue Jun 5, 2023 · 1 comment · Fixed by #3361 or #3370

Comments

@DavNobrega
Copy link

Details of the scenario you tried and the problem that is occurring

Error while trying to do Export-M365DSCConfiguration -Credential $Credential -Workloads INTUNE

error in module IntuneAntivirusPolicyWindows10SettingCatalog

Verbose logs showing the problem

[2023/06/05 02:07:31]
{InvalidData}
System.Management.Automation.ParameterBindingValidationException: Cannot validate argument on parameter 'templateId'. The argument "e3f74c5a-a6de-411d-aef6-eb15628f3a0a_1" does not belong to the set "d948ff9b-99cb-4ee0-8012-1fbc09685377_1,45fea5e9-280d-4da1-9792-fb5736da0ca9_1,804339ad-1553-4478-a742-138fb5807418_1" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. ---> System.Management.Automation.ValidationMetadataException: The argument "e3f74c5a-a6de-411d-aef6-eb15628f3a0a_1" does not belong to the set "d948ff9b-99cb-4ee0-8012-1fbc09685377_1,45fea5e9-280d-4da1-9792-fb5736da0ca9_1,804339ad-1553-4478-a742-138fb5807418_1" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.
at System.Management.Automation.ValidateSetAttribute.ValidateElement(Object element)
at System.Management.Automation.ParameterBinderBase.BindParameter(CommandParameterInternal parameter, CompiledCommandParameter parameterMetadata, ParameterBindingFlags flags)
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
"Error during Export:"
at Connect-M365Tenant, C:\Program Files\WindowsPowerShell\Modules\MSCloudLoginAssistant\1.0.110\MSCloudLoginAssistant.psm1: line 92
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.517.1\modules\M365DSCReverse.psm1: line 523
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.517.1\modules\M365DSCUtil.psm1: line 1288
at , : line 1

Suggested solution to the issue

The DSC configuration that is used to reproduce the issue (as detailed as possible)

The operating system the target node is running

Win 10

Version of the DSC module that was used ('dev' if using current dev branch)

1.23.517.1

@ricmestre
Copy link
Contributor

ricmestre commented Jun 5, 2023

While debugging issue with David it seems that DeviceManagementConfigurationPolicy(ies) of templateFamily endpointSecurityAntivirus can have an additional templateId (e3f74c5a-a6de-411d-aef6-eb15628f3a0a_1) which is missing in the ValidateSet's of the module and therefore then complains when exporting (but it will also fail on Set and Test), this is fixed on my PR #3361.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants