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

DEVOPS - The property 'intValue' does not exist on type 'microsoft.management.services.api.deviceManagementConfigurationIntegerSettingValue #3582

Closed
stvnmbr1 opened this issue Aug 17, 2023 · 12 comments · Fixed by #3873 or #3895
Labels
Bug Something isn't working Intune

Comments

@stvnmbr1
Copy link
Contributor

Description of the issue

Exported Intune configuration from tenant
translate/copy exported config to relevant schema files

Deploy through DevOps -> The property 'intValue' does not exist .

This is for multiple configs where intValue is defined

Microsoft 365 DSC Version

1.23.809.1

Which workloads are affected

other

The DSC configuration

IntuneSettingCatalogCustomPolicyWindows10 "IntuneSettingCatalogCustomPolicyWindows10-822d3d16-1dca-4b55-b24e-27a499dc2eda"
{
Assignments = @();
Credential = $Credential;
Description = "";
Ensure = "Present";
Id = "822d3d16-1dca-4b55-b24e-27a499dc2eda";
Name = "Windows | Lock screen | 5 minutes";
Platforms = "windows10";
Settings = @(
MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{

            SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                SettingDefinitionId = 'device_vendor_msft_policy_config_devicelock_devicepasswordenabled'

                choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{
                    Value = 'device_vendor_msft_policy_config_devicelock_devicepasswordenabled_0'

                    Children = @(
                        MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                            SettingDefinitionId = 'device_vendor_msft_policy_config_devicelock_maxinactivitytimedevicelock'
                            odataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'

                            simpleSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationSimpleSettingValue{
                                odataType = '#microsoft.graph.deviceManagementConfigurationIntegerSettingValue'
                                IntValue = 5
                            }

                        }
                    )
                }
                odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
            }

        }
    );
    Technologies         = "mdm";
}

Verbose logs showing the problem

2023-08-14T14:36:29.6913266Z [[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-822d3d16-1dca-4b55-b24e-27a499dc2
2023-08-14T14:36:29.6943936Z eda::[Intune]Intune_Configuration] Creating an Intune Setting Catalog Custom Policy for Windows10 with Name {}
2023-08-14T14:36:30.0889775Z ##[error][ModelValidationFailure] : The property 'intValue' does not exist on type
'microsoft.management.services.api.deviceManagementConfigurationIntegerSettingValue'. Make sure to only use property
names that are defined by the type.
+ CategoryInfo : InvalidOperation: ({ body = Micros...urationPolicy }:) [], CimException
+ FullyQualifiedErrorId : ModelValidationFailure,Microsoft.Graph.Beta.PowerShell.Cmdlets.NewMgBetaDeviceManagement
ConfigurationPolicy_Create
+ PSComputerName : localhost
2023-08-14T14:36:30.0978212Z VERBOSE: [test]: LCM: [ End Set ]
2023-08-14T14:36:30.0986590Z [[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-822d3d16-1dca-4b55-b24e-27a499dc2
2023-08-14T14:36:30.0992362Z eda::[Intune]Intune_Configuration] in 1.2030 seconds.
2023-08-14T14:36:30.1203267Z ##[error]The PowerShell DSC resource '[IntuneSettingCatalogCustomPolicyWindows10]IntuneSettingCatalogCustomPolicyWindows10-822d3
d16-1dca-4b55-b24e-27a499dc2eda::[Intune]Intune_Configuration' with SourceInfo 'C:\Users\Azureadmin\Downloads\vsts-agen
t-win-x64-3.225.0_work\1\s\M365Config\0.0.1\DSCResources\Intune\Intune.schema.psm1::1104::5::IntuneSettingCatalogCusto
mPolicyWindows10' threw one or more non-terminating errors while running the Set-TargetResource functionality. These
errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost

Environment Information + PowerShell Version

Devops ENV following whitepaper
@stvnmbr1
Copy link
Contributor Author

related to #3578

@stvnmbr1
Copy link
Contributor Author

stvnmbr1 commented Aug 17, 2023

https://learn.microsoft.com/en-us/graph/api/resources/intune-deviceconfigv2-devicemanagementconfigurationintegersettingvalue?view=graph-rest-beta

{
"@odata.type": "#microsoft.graph.deviceManagementConfigurationIntegerSettingValue",
"settingValueTemplateReference": {
"@odata.type": "microsoft.graph.deviceManagementConfigurationSettingValueTemplateReference",
"settingValueTemplateId": "String",
"useTemplateDefault": true
},
"value": 1024
}

@stvnmbr1 stvnmbr1 changed the title DEVOPS - The property 'stringValue' does not exist on type 'microsoft.management.services.api.deviceManagementConfigurationStringSettingValue' DEVOPS - The property 'intValue' does not exist on type 'microsoft.management.services.api.deviceManagementConfigurationIntegerSettingValue Aug 17, 2023
@andikrueger andikrueger added Bug Something isn't working Intune labels Aug 17, 2023
@richardjgreen
Copy link

richardjgreen commented Nov 8, 2023

Same issue here running 1.23.906.1 via Azure DevOps. Is affecting anything which references MSFT_MicrosoftGraphDeviceManagementConfigurationSimpleSettingValue because stringValue and intValue are reported as not existing on type.

The property 'intValue' does not exist on type

I have multiple examples of this not working, however, one example is as follows.

``IntuneSettingCatalogCustomPolicyWindows10 "IntuneSettingCatalogCustomPolicyWindows10-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
{
ApplicationId = $ConfigurationData.NonNodeData.ApplicationId;
Assignments = @();
CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
Description = "";
Ensure = "Present";
Id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx";
Name = "WHFB";
Platforms = "windows10";
Settings = @(
MSFT_MicrosoftGraphdeviceManagementConfigurationSetting{

                SettingInstance = MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{

                    groupSettingCollectionValue = @(
                        MSFT_MicrosoftGraphDeviceManagementConfigurationGroupSettingValue{

                            Children = @(
                                MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                                    SettingDefinitionId = 'device_vendor_msft_passportforwork_{tenantid}_policies_pincomplexity_expiration'

                                    simpleSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationSimpleSettingValue{
                                        odataType = '#microsoft.graph.deviceManagementConfigurationIntegerSettingValue'
                                        IntValue = 0
                                    }                                        odataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                }
                                MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{

                                    choiceSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationChoiceSettingValue{

                                        Value = 'device_vendor_msft_passportforwork_{tenantid}_policies_pincomplexity_lowercaseletters_0'
                                    }                                        SettingDefinitionId = 'device_vendor_msft_passportforwork_{tenantid}_policies_pincomplexity_lowercaseletters'
                                    odataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                }
                                MSFT_MicrosoftGraphDeviceManagementConfigurationSettingInstance{
                                    SettingDefinitionId = 'device_vendor_msft_passportforwork_{tenantid}_policies_pincomplexity_maximumpinlength'

                                    simpleSettingValue = MSFT_MicrosoftGraphDeviceManagementConfigurationSimpleSettingValue{
                                        odataType = '#microsoft.graph.deviceManagementConfigurationIntegerSettingValue'
                                        IntValue = 7
                                    }                                        odataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                }
                            )

                        }                        )
                    SettingDefinitionId = 'device_vendor_msft_passportforwork_{tenantid}'
                    odataType = '#microsoft.graph.deviceManagementConfigurationGroupSettingCollectionInstance'
                }
            }
            });
        Technologies          = "mdm";
        TenantId              = $OrganizationName;
    }
}``

@ricmestre
Copy link
Contributor

That's because an object with odataType '#microsoft.graph.deviceManagementConfigurationIntegerSettingValue' doesn't have an IntValue property but instead is just value, see https://learn.microsoft.com/en-us/graph/api/resources/intune-shared-devicemanagementconfigurationintegersettingvalue?view=graph-rest-beta. Same thing happens with odataType '#microsoft.graph.deviceManagementConfigurationStringSettingValue' where it should have property value instead of StringValue.

@William-Francillette Hi, since you created this resource could you please look into this? Bear in mind that by the configurations shared here the resource also looks like it has problems with some properties not being placed in their own correct line which will also create problems compiling to MOF, but it's most likely already solved in more recent DSC versions since me and Nik made some changes to fix this.

@William-Francillette
Copy link
Contributor

Odatatype and intvalue are renamed during set-targetresource
They are only used to accommodate all type of settings

For the property not in the correct line, Yorick showed me a type yesterday where StringValue was using instead of StringValues l194

I'll have a look tonight and if you have issue with the resource could you send me the extract please that will help me

@ricmestre
Copy link
Contributor

By the title of the issue looks like the renaming is actually not being done, but you should know better I didn't look to the code yet :)

I don't have any blueprints to show since we don't use this type of policy, one of the reporters should provide this, but please have a look at my PR #3705, the indentation is setup in your M365DSCDRGUtil module.

@William-Francillette
Copy link
Contributor

Cool will check after work

@richardjgreen
Copy link

Thanks for all the comments. I tried as @ricmestre you suggested and changed IntValue to Value and VS Code returns that Value is not a valid property so I think there is merit to what @William-Francillette is saying about the rename, however, it does indeed look like something isn't happening as it should.

I've got plenty of examples and happy to assist in testing so let me know.

@William-Francillette
Copy link
Contributor

William-Francillette commented Nov 8, 2023

Good news I found the issue 😜
It was only a missing parameter in the Rename-M365DSCCimInstanceParameter function.

@richardjgreen
Copy link

Good news I found the issue 😜 It was only a missing parameter in the Rename-M365DSCCimInstanceParameter function.

Thank you for identifying this and submitting the PR to fix it @William-Francillette.
Do we know what release this would make it's way into once the PR is accepted?

We've held back on the 906 build because of another bug (#3438), however, 1 ESP policy vs. multiple Setting Catalog policies, I think we'd probably accept the ESP bug and roll forwards to a new release.

@William-Francillette
Copy link
Contributor

My pleasure @richardjgreen check my reply for #3438 hopefully you should be able to use the resource
Releases are on Wednesdays if I'm not mistaken - @andikrueger can you confirm?

@richardjgreen
Copy link

My pleasure @richardjgreen check my reply for #3438 hopefully you should be able to use the resource Releases are on Wednesdays if I'm not mistaken - @andikrueger can you confirm?

I actually tagged the wrong issue. We've got a few as you can tell.
The issue we had held back onto 906 for was #3442.

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
Projects
None yet
5 participants