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

IntuneDeviceConfigurationPolicyAndroidDeviceOwner: Cannot deploy if DetailedHelpText, DeviceOwnerLockScreenMessage or ShortHelpText are defined #5411

Open
ricmestre opened this issue Nov 15, 2024 · 4 comments · May be fixed by #5412

Comments

@ricmestre
Copy link
Contributor

Description of the issue

IntuneDeviceConfigurationPolicyAndroidDeviceOwner can define the properties DetailedHelpText, DeviceOwnerLockScreenMessage or ShortHelpText, which are a CIM instance of type MSFT_MicrosoftGraphandroiddeviceowneruserfacingmessage, but if they are in the configuration then when trying to deploy the policy it fails with Request is invalid.

It looks like the problem is being caused by the CIM instance being sent without the @odata.type which should be set to #microsoft.graph.androidDeviceOwnerUserFacingMessage

Microsoft 365 DSC Version

1.24.1113.1

Which workloads are affected

Intune

The DSC configuration

IntuneDeviceConfigurationPolicyAndroidDeviceOwner "IntuneDeviceConfigurationPolicyAndroidDeviceOwner-IntuneDeviceConfigurationPolicyAndroidDeviceOwner_1"
        {
            AppsAllowInstallFromUnknownSources             = $False;
            AppsDefaultPermissionPolicy                    = "autoGrant";
            AppsRecommendSkippingFirstUseHints             = $False;
            Assignments                                    = @(
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    groupDisplayName = 'DummyGroupInclude'
                    dataType = '#microsoft.graph.groupAssignmentTarget'
                    groupId = '1e503d88-4cde-4c67-8595-1d3e62618f21'
                }
            );
            AzureAdSharedDeviceDataClearApps               = @();
            Credential                                     = $CredsCredential;
            CrossProfilePoliciesAllowCopyPaste             = $True;
            CrossProfilePoliciesAllowDataSharing           = "notConfigured";
            DetailedHelpText                               = MSFT_MicrosoftGraphandroiddeviceowneruserfacingmessage{
                DefaultMessage = 'Contact Servicedesk in need of support.'
            };
            DeviceOwnerLockScreenMessage                   = MSFT_MicrosoftGraphandroiddeviceowneruserfacingmessage{
                DefaultMessage = 'Contact Servicedesk in need of support.'
            };
            DisplayName                                    = "IntuneDeviceConfigurationPolicyAndroidDeviceOwner_1";
            EnrollmentProfile                              = "notConfigured";
            Ensure                                         = "Present";
            FactoryResetDeviceAdministratorEmails          = @();
            Id                                             = "b1342588-3c4b-4c41-a569-d6a64ba31d13";
            KioskCustomizationStatusBar                    = "notConfigured";
            KioskCustomizationSystemNavigation             = "notConfigured";
            KioskModeAppPositions                          = @();
            KioskModeApps                                  = @();
            KioskModeManagedFolders                        = @();
            KioskModeUseManagedHomeScreenApp               = "notConfigured";
            KioskModeWifiAllowedSsids                      = @();
            PasswordBlockKeyguardFeatures                  = @();
            PasswordMinutesOfInactivityBeforeScreenTimeout = 10;
            PasswordPreviousPasswordCountToBlock           = 5;
            PasswordRequiredType                           = "required";
            PasswordRequireUnlock                          = "deviceDefault";
            PersonalProfilePersonalApplications            = @();
            PersonalProfilePlayStoreMode                   = "notConfigured";
            PersonalProfileScreenCaptureBlocked            = $False;
            ScreenCaptureBlocked                           = $False;
            SecurityDeveloperSettingsEnabled               = $True;
            SecurityRequireVerifyApps                      = $True;
            ShortHelpText                                  = MSFT_MicrosoftGraphandroiddeviceowneruserfacingmessage{
                DefaultMessage = 'Contact Servicedesk for support.'
            };
            StayOnModes                                    = @();
            SystemUpdateFreezePeriods                      = @();
            VpnAlwaysOnLockdownMode                        = $False;
            VpnAlwaysOnPackageIdentifier                   = "";
            WorkProfilePasswordRequiredType                = "deviceDefault";
            WorkProfilePasswordRequireUnlock               = "deviceDefault";
        }

Verbose logs showing the problem

The request is invalid.
+ CategoryInfo          : InvalidOperation: ({ Headers = , b...Configuration }:) [], CimException
+ FullyQualifiedErrorId : Microsoft.Graph.Beta.PowerShell.Cmdlets.NewMgBetaDeviceManagementDeviceConfiguration_Create
+ PSComputerName        : localhost

Environment Information + PowerShell Version

Win11/PS5.1
@ricmestre
Copy link
Contributor Author

ricmestre commented Nov 15, 2024

I patched the resource to send '@odata.type' set to #microsoft.graph.androidDeviceOwnerUserFacingMessage in the CIM instance and I see it being sent in the request but it still fails.

The problem is really with these 3 properties, if I remove them from the request being sent the resource is deployed without issues so not sure exactly what the issue is.

@FabienTschanz
Copy link
Contributor

@ricmestre Do you want me to take a look at it?

@ricmestre
Copy link
Contributor Author

@FabienTschanz Thank you Fabien, I think I got it, LocalizedMessages must always be sent in those requests even if they're null.

I'll raise a PR with the fix.

@FabienTschanz
Copy link
Contributor

Alright 👍

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