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

Intune*: Several resources stopped working #5666

Closed
ricmestre opened this issue Jan 23, 2025 · 2 comments · Fixed by #5665
Closed

Intune*: Several resources stopped working #5666

ricmestre opened this issue Jan 23, 2025 · 2 comments · Fixed by #5665

Comments

@ricmestre
Copy link
Contributor

Description of the issue

@FabienTschanz When you introduced the caching behaviour to Intune workload you missed that some of those Intune resources still have their get inside Get-TargetResource with "-ErrorAction Stop" which means that if the Id of the resource is not found, I use bogus Ids on purpose in order to test multitenant scenario, the processing of the resource is aborted, this was working before since those gets were inside try/catch blocks and the catch block just assigned $getValue = $null or something equivalent which now it doesn't.

See example of breakage starting on this line here, just check the rest of the get block below it:

And another here:

I don't have time to see which ones are actually affected by this since I need to go back to a working version to test something else so could you please check this?

Microsoft 365 DSC Version

1.25.122.1

Which workloads are affected

Intune

The DSC configuration

IntuneAppConfigurationPolicy "IntuneAppConfigurationPolicy-IntuneAppConfigurationPolicy_1"
        {
            ApplicationId         = $IntuneApplicationId;
            Assignments           = @(
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    groupDisplayName = 'DummyGroupExclude'
                    dataType = '#microsoft.graph.exclusionGroupAssignmentTarget'
                    groupId = '053dc89a-be83-411a-bad3-909904b7239e'
                }
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    groupDisplayName = 'DummyGroupInclude'
                    dataType = '#microsoft.graph.groupAssignmentTarget'
                    groupId = 'b0b8fd3f-af2a-453b-be57-80182d599f02'
                }
            );
            CertificateThumbprint = $IntuneCertThumbprint;
            CustomSettings        = @(
                MSFT_IntuneAppConfigurationPolicyCustomSetting{
                    name = 'com.microsoft.intune.mam.managedbrowser.AppProxyRedirection'
                    value = 'false'
                }
                MSFT_IntuneAppConfigurationPolicyCustomSetting{
                    name = 'com.microsoft.intune.mam.managedbrowser.AllowTransitionOnBlock'
                    value = 'true'
                }
                MSFT_IntuneAppConfigurationPolicyCustomSetting{
                    name = 'com.microsoft.outlook.Contacts.LocalSyncEnabled'
                    value = 'true'
                }
                MSFT_IntuneAppConfigurationPolicyCustomSetting{
                    name = 'com.microsoft.outlook.Contacts.LocalSyncEnabled.UserChangeAllowed'
                    value = 'true'
                }
            );
            DisplayName           = "IntuneAppConfigurationPolicy_1";
            Ensure                = "Present";
            Id                    = "44754094-9c69-4ee0-b587-d8af4efd4a7e";
            TenantId              = $OrganizationName;
        }

Verbose logs showing the problem

##vso[task.logissue type=error]Deploy execution failed ❌: PowerShell DSC resource MSFT_IntuneAppConfigurationPolicy  failed to execute Test-TargetResource functionality with error message: An error occured in Get-TargetResource, the policy {IntuneAppConfigurationPolicy_1} will not be processed. Refer to the event viewer logs for more information.

Environment Information + PowerShell Version

Win11/PS5.1
@FabienTschanz
Copy link
Contributor

Will check.

@FabienTschanz
Copy link
Contributor

@ricmestre PR #5665 now contains the changes. 4 resources were affected by my check.

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

Successfully merging a pull request may close this issue.

2 participants