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

IntuneSettingCatalogCustomPolicyWindows10: Export gets ResourceInstanceName with the Id instead of Name #4333

Closed
ricmestre opened this issue Feb 15, 2024 · 0 comments · Fixed by #4334 or #4387
Labels
Bug Something isn't working Intune V1.24.207.2 Version 1.24.207.2

Comments

@ricmestre
Copy link
Contributor

Description of the issue

Now that IntuneSettingCatalogCustomPolicyWindows10 is finally working with ConvertTo-DSCObject I was able to test it, and found a small problem when getting it through my internal tests which is when the export is done the ResourceInstanceName ends up with the Id instead of its Name like most other policies (which use DisplayName instead of Name as key and therefore show up correctly).

The issue is with the order of the conditions in the function Get-M365DSCExportContentForResource and fixing this is just a matter of hoisting the condition looking for the key Name right to just before the condition for the key Id.

Microsoft 365 DSC Version

1.24.207.2

Which workloads are affected

other

The DSC configuration

IntuneSettingCatalogCustomPolicyWindows10 "IntuneSettingCatalogCustomPolicyWindows10-fc8be7c8-b4ac-4821-8430-751cabc4138e"
        {
            Assignments          = @(
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    dataType = '#microsoft.graph.exclusionGroupAssignmentTarget'
                    groupId = '053dc89a-be83-411a-bad3-909904b7239e'
                }
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    dataType = '#microsoft.graph.groupAssignmentTarget'
                    groupId = 'b0b8fd3f-af2a-453b-be57-80182d599f02'
                }
            );
            Credential           = $Credscredential;
            Description          = "IntuneSettingCatalogCustomPolicyWindows10_1";
            Ensure               = "Present";
            Id                   = "fc8be7c8-b4ac-4821-8430-751cabc4138e";
            Name                 = "IntuneSettingCatalogCustomPolicyWindows10_1";
            Platforms            = "windows10";
            Settings             = @(
                MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{
                    SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                        choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                            Value = 'device_vendor_msft_policy_config_updatev83diff~policy~cat_edgeupdate~cat_applications_pol_defaultcreatedesktopshortcut_0'
                        }
                        SettingDefinitionId = 'device_vendor_msft_policy_config_updatev83diff~policy~cat_edgeupdate~cat_applications_pol_defaultcreatedesktopshortcut'
                        odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                    }
                }
            );
            Technologies         = "mdm";
        }

Verbose logs showing the problem

N/A

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, en-GB}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                                                                                                                                  Name                           Value                                                                                                                                                                               ----                           -----                                                                                                                                                                               PSVersion                      5.1.22621.1778                                                                                                                                                                      PSEdition                      Desktop                                                                                                                                                                             PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                             BuildVersion                   10.0.22621.1778                                                                                                                                                                     CLRVersion                     4.0.30319.42000                                                                                                                                                                     WSManStackVersion              3.0                                                                                                                                                                                 PSRemotingProtocolVersion      2.3                                                                                                                                                                                 SerializationVersion           1.1.0.1
@andikrueger andikrueger added Bug Something isn't working Intune V1.24.207.2 Version 1.24.207.2 labels Feb 20, 2024
ykuijs added a commit that referenced this issue Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Intune V1.24.207.2 Version 1.24.207.2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants