microsoft / Microsoft365DSC

Manages, configures, extracts and monitors Microsoft 365 tenant configurations
https://aka.ms/M365DSC
MIT License
1.6k stars 500 forks source link

Getting System.Management.Automation.MethodInvocationException when running Export-M365DSCConfiguration #3352

Closed meklulose closed 1 year ago

meklulose commented 1 year ago
ISSUE DESCRIPTION:

I am getting the following error:

{NotSpecified}
System.Management.Automation.MethodInvocationException: Exception calling "IndexOf" with "2" argument(s): "Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex" ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
   at System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType)
   at CallSite.Target(Closure , CallSite , String , String , Object )
   --- End of inner exception stack trace ---
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at Convert-DSCStringParamToVariable(Closure , FunctionContext )
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
   at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
   at System.Management.Automation.CommandProcessorBase.Complete()
"Error during Export:"
at Convert-DSCStringParamToVariable, C:\Program Files\WindowsPowerShell\Modules\ReverseDSC\2.0.0.14\ReverseDSC.Core.psm1: line 766
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.517.1\DSCResources\MSFT_IntuneSettingCatalogCustomPolicyWindows10\MSFT_IntuneSettingCatalogCustomPolicyWindows10.psm1: line 687
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.517.1\modules\M365DSCReverse.psm1: line 619
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.517.1\modules\M365DSCUtil.psm1: line 1308
at <ScriptBlock>, C:\Users\getIntuneClientSecret.ps1: line 10

I am running the following command: Export-M365DSCConfiguration -Components @("IntuneSettingCatalogCustomPolicyWindows10") -ApplicationId $ApplicationId -ApplicationSecret $ApplicationSecret -TenantId $TenantId

I am able to get rest of the configuration for Intune out. I just have issue with this one. I am running this on windows PowerShell ISE. Microsoft365DSC version 1.23.517.1

andikrueger commented 1 year ago

Could you run a test in a plain powershell session? The error description looks like an issue with an Intune resource.

andikrueger commented 1 year ago

@William-Francillette could you have a look at this within #3309

William-Francillette commented 1 year ago

@meklulose , could you share more information about the policy you are trying to export please?

The IntuneSettingCatalogCustomPolicyWindows10 is very generic and to troubleshoot the issue I would need to know which setting is configured in your policy

meklulose commented 1 year ago

@William-Francillette I get the the same error when running in plain PowerShell session. It always fails when trying to extract "Microsoft Edge (EDM) Configuration Profile"

William-Francillette commented 1 year ago

Can you send the exact settings configured in your policy please? They are a few different setting types and would like to reproduce the error on my side image

meklulose commented 1 year ago

@William-Francillette Please see the following screenshot image

William-Francillette commented 1 year ago

Thanks, that's perfect - I'll have a look at it tonight

William-Francillette commented 1 year ago

@meklulose, I was able to export the resource, compile it, test it without drift and update it, using those settings in the screenshot - I've added the export below

Could you share more trace of the error please as the issue could be external to the resource itself

Thanks

        IntuneSettingCatalogCustomPolicyWindows10 "IntuneSettingCatalogCustomPolicyWindows10-4e300eed-1d37-493e-a680-12988874587f"
        {
            ApplicationId         = $ConfigurationData.NonNodeData.ApplicationId;
            Assignments           = @(
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    dataType = '#microsoft.graph.allDevicesAssignmentTarget'
                }
            );
            CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
            Description           = "";
            Ensure                = "Present";
            Id                    = "4e300eed-1d37-493e-a680-12988874587f";
            Name                  = "Setting Catalog Raw";
            Platforms             = "windows10";
            Settings              = @(
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'device_vendor_msft_policy_config_abovelock_allowcortanaabovelock_1'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_abovelock_allowcortanaabovelock'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        SettingDefinitionId = 'device_vendor_msft_policy_config_applicationdefaults_defaultassociationsconfiguration'
                        simpleSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationSimpleSettingValue{
                            odataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                            StringValue = ''
                        }
                        odataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'device_vendor_msft_policy_config_applicationdefaults_enableappurihandlers_1'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_applicationdefaults_enableappurihandlers'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'device_vendor_msft_policy_config_defender_allowarchivescanning_1'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_defender_allowarchivescanning'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'device_vendor_msft_policy_config_defender_allowbehaviormonitoring_1'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_defender_allowbehaviormonitoring'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'device_vendor_msft_policy_config_defender_allowcloudprotection_1'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_defender_allowcloudprotection'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Children = @(
                                MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                                    SettingDefinitionId = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_managedfavorites_managedfavorites'
                                    simpleSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationSimpleSettingValue{
                                        odataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                        StringValue = 'test'
                                    }
                                    odataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                }
                            )
                            Value = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_managedfavorites_1'
                        }
                        SettingDefinitionId = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_managedfavorites'
                        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_edge~policy~microsoft_edge_internetexplorerintegrationlevel_internetexplorerintegrationlevel_1'
                                    }
                                    SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_internetexplorerintegrationlevel_internetexplorerintegrationlevel'
                                    odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                }
                            )
                            Value = 'device_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_internetexplorerintegrationlevel_1'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_internetexplorerintegrationlevel'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'device_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_backgroundmodeenabled_0'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_backgroundmodeenabled'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_backgroundmodeenabled_0'
                        }
                        SettingDefinitionId = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_backgroundmodeenabled'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Children = @(
                                MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                                    SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge~extensions_extensioninstallallowlist_extensioninstallallowlistdesc'
                                    simpleSettingCollectionValue = @(
                                        MSFT_MicrosoftGraphDeviceManagementConfigurationSimpleSettingValue{
                                            odataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                            StringValue = '*'
                                        }
                                    )
                                    odataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingCollectionInstance'
                                }
                            )
                            Value = 'device_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge~extensions_extensioninstallallowlist_1'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge~extensions_extensioninstallallowlist'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Children = @(
                                MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                                    SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge~extensions_extensioninstallblocklist_extensioninstallblocklistdesc'
                                    simpleSettingCollectionValue = @(
                                        MSFT_MicrosoftGraphDeviceManagementConfigurationSimpleSettingValue{
                                            odataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                            StringValue = '123456789456'
                                        }
                                    )
                                    odataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingCollectionInstance'
                                }
                            )
                            Value = 'device_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge~extensions_extensioninstallblocklist_1'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge~extensions_extensioninstallblocklist'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'device_vendor_msft_policy_config_microsoft_edgev80diff~policy~microsoft_edge_hidefirstrunexperience_1'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edgev80diff~policy~microsoft_edge_hidefirstrunexperience'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'device_vendor_msft_policy_config_microsoft_edgev99~policy~microsoft_edge_hubssidebarenabled_0'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edgev99~policy~microsoft_edge_hubssidebarenabled'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'device_vendor_msft_policy_config_microsoft_edgev88~policy~microsoft_edge_recommended~performance_recommended_startupboostenabled_recommended_0'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_microsoft_edgev88~policy~microsoft_edge_recommended~performance_recommended_startupboostenabled_recommended'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'user_vendor_msft_policy_config_microsoft_edgev88~policy~microsoft_edge_recommended~performance_recommended_startupboostenabled_recommended_0'
                        }
                        SettingDefinitionId = 'user_vendor_msft_policy_config_microsoft_edgev88~policy~microsoft_edge_recommended~performance_recommended_startupboostenabled_recommended'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Children = @(
                                MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                                    choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                                        Value = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_recommended~startup_recommended_restoreonstartup_recommended_restoreonstartup_1'
                                    }
                                    SettingDefinitionId = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_recommended~startup_recommended_restoreonstartup_recommended_restoreonstartup'
                                    odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                }
                            )
                            Value = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_recommended~startup_recommended_restoreonstartup_recommended_1'
                        }
                        SettingDefinitionId = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_recommended~startup_recommended_restoreonstartup_recommended'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Children = @(
                                MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                                    SettingDefinitionId = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_recommended~startup_recommended_homepagelocation_recommended_homepagelocation'
                                    simpleSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationSimpleSettingValue{
                                        odataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                        StringValue = 'test.com'
                                    }
                                    odataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                }
                            )
                            Value = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_recommended~startup_recommended_homepagelocation_recommended_1'
                        }
                        SettingDefinitionId = 'user_vendor_msft_policy_config_microsoft_edge~policy~microsoft_edge_recommended~startup_recommended_homepagelocation_recommended'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Children = @(
                                MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                                    choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                                        Value = 'user_vendor_msft_policy_config_microsoft_edgev79diff~policy~microsoft_edge_recommended~startup_recommended_newtabpagesetfeedtype_recommended_newtabpagesetfeedtype_0'
                                    }
                                    SettingDefinitionId = 'user_vendor_msft_policy_config_microsoft_edgev79diff~policy~microsoft_edge_recommended~startup_recommended_newtabpagesetfeedtype_recommended_newtabpagesetfeedtype'
                                    odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                }
                            )
                            Value = 'user_vendor_msft_policy_config_microsoft_edgev79diff~policy~microsoft_edge_recommended~startup_recommended_newtabpagesetfeedtype_recommended_1'
                        }
                        SettingDefinitionId = 'user_vendor_msft_policy_config_microsoft_edgev79diff~policy~microsoft_edge_recommended~startup_recommended_newtabpagesetfeedtype_recommended'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
            );
            Technologies          = "mdm";
            TenantId              = $OrganizationName;
        }
William-Francillette commented 1 year ago

I tried using certificate thumbprint and client secret, both authentications worked

Can you ensure your service principal has at least
"DeviceManagementConfiguration.Read.All" and if update needed "DeviceManagementConfiguration.ReadWrite.All"

meklulose commented 1 year ago

@William-Francillette How would I get more detailed tracing? My event viewer also shows the same error message `- -

1 0 2 1 0 0x80000000000000 4554 M365DSC PS25477.propertyservices.nhs.uk

-

Error during Export: { Exception calling "IndexOf" with "2" argument(s): "Index was out of range. Must be non-negative and less than the size of the collection. \ Parameter name: startIndex" } \ at Convert-DSCStringParamToVariable, C:\Program Files\WindowsPowerShell\Modules\ReverseDSC\2.0.0.14\ReverseDSC.Core.psm1: line 766 \ at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.517.1\DSCResources\MSFT_IntuneSettingCatalogCustomPolicyWindows10\MSFT_IntuneSettingCatalogCustomPolicyWindows10.psm1: line 687 \ at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.517.1\modules\M365DSCReverse.psm1: line 619 \ at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.517.1\modules\M365DSCUtil.psm1: line 1308 \ at , : line 8

`

The problem might be the policy named "Microsoft Edge Configuration Profile" is there a way I can run the script but exclude it from trying to extract this policy? Thanks for your help!

William-Francillette commented 1 year ago

The display name is not a key word so it should be fine

The code below should allow you to display Get-TargetResource output - Could you modify any variable value such as \<variable> and send us the output please:

$params = @{
    Id                          = "<myPolicyId>"
    ApplicationId               = "<myAppId>"
    TenantId                    = "<myDomain>"
    ApplicationSecret           = "<MySecret>"
}
$ResourcePath = "<PathToDSCModule>\Modules\Microsoft365DSC\DSCResources"
$ResourceName = 'IntuneSettingCatalogCustomPolicyWindows10'
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' `
                    -InboundParameters $params `
                    -ProfileName 'beta'

import-module "$ResourcePath\MSFT_$ResourceName" -force
$results=Get-TargetResource @params
$results|convertto-json -depth 100

Could you make sure to hide any confidential information please except for special character that may cause the export to fail such as quotes for example I'm guessing that one of the textbox values in your screenshot is the culprit

andikrueger commented 1 year ago

@meklulose any chance you could share additional information?

Is this still an issue with the current version of M365DSC?

NikCharlebois commented 1 year ago

Closing due to inactivity

ghost commented 11 months ago

I am getting this issue again using version '1.23.1115.1'.

Similar policy settings (Edge Browser), did we ever find out what the issue was?

Thanks in advance.