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

IntuneDeviceConfigurationPolicyMacOS : At least one of the values 'delayAppUpdateVisibility,delayMajorOsUpdateVisibility' is not supported #2731

Closed
hvdbrink opened this issue Jan 3, 2023 · 11 comments · Fixed by #2734, #2745, #2787 or #2800
Assignees
Labels
Bug Something isn't working Intune

Comments

@hvdbrink
Copy link

hvdbrink commented Jan 3, 2023

Details of the scenario you tried and the problem that is occurring

This happens after an export of the workload of Intune.

Verbose logs showing the problem

Microsoft365DSC\IntuneDeviceConfigurationPolicyMacOS : At least one of the values 'delayAppUpdateVisibility,delayMajorOsUpdateVisibility' is not supported or valid for property 'UpdateDelayPolicy' on class 'IntuneDeviceConfigurationPolicyMacOS'. Please specify only supported values:
none, delayOSUpdateVisibility, delayAppUpdateVisibility, unknownFutureValue, delayMajorOsUpdateVisibility.
At Path/filename.ps1:1589 char:9

  •     IntuneDeviceConfigurationPolicyMacOS 9a43fd65-02fc-4590-b154- ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Write-Error], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : UnsupportedValueForProperty,Microsoft365DSC\IntuneDeviceConfigurationPolicyMacOS

Suggested solution to the issue

The DSC configuration that is used to reproduce the issue (as detailed as possible)

Version of the DSC module that was used ('dev' if using current dev branch)

1.22.1221.1

@ykuijs
Copy link
Member

ykuijs commented Jan 3, 2023

The parameter UpdateDelayPolicy is stored and returned as a string, but is an array of values under the covers (comma separated string). This means that it needs to get split on the comma character.

A second issue is that the current parameter is a string value, instead of an array value. This needs to get updated as well.

Working on correcting this issue.

@ykuijs ykuijs self-assigned this Jan 3, 2023
@ykuijs ykuijs added Bug Something isn't working Intune labels Jan 3, 2023
@ykuijs ykuijs mentioned this issue Jan 3, 2023
@hvdbrink
Copy link
Author

hvdbrink commented Jan 5, 2023

I've just updated and checked, but the error is still there for me.
UpdateDelayPolicy = "delayAppUpdateVisibility","delayMajorOsUpdateVisibility"; == This one works with creating the mof file.
UpdateDelayPolicy = @("delayAppUpdateVisibility,delayMajorOsUpdateVisibility"); = is how it's generated now.

@ykuijs
Copy link
Member

ykuijs commented Jan 10, 2023

I see what the difference is between the two values you shared. Will investigate and correct the issue.

@ykuijs ykuijs reopened this Jan 10, 2023
@William-Francillette
Copy link
Contributor

I believe the updateDelayPolicy should be a single value and not an array as it is an enum
https://learn.microsoft.com/en-us/graph/api/resources/intune-deviceconfig-macossoftwareupdatedelaypolicy?view=graph-rest-beta

@ykuijs
Copy link
Member

ykuijs commented Jan 16, 2023

Not quite, the updateDelayPolicy can contain multiple values in Intune. Before the previous PR, this resulted in errors because the cmdlets return multiple values and the config only accepts a single value.

@William-Francillette
Copy link
Contributor

A bit confused here as the policy should return a single value based on the definition
image
I also checked the metadata schema and there is no mention of collection
image

If the resource returns more than one value, it could be an issue with the Get-TargetResource

Probably best to check what Get-MgDeviceManagementDeviceConfiguration returns

image
The first Get using DisplayName could return multiple policies as the DisplayName is not unique - if that's the case then $getValue.AdditionalProperties.updateDelayPolicy will return multiple value

Possible fix would be to reduce the scope of Get-MgDeviceManagementDeviceConfiguration and DisplayName by adding the templateId of the policy - I also prefer using the Id as a first method to retrieve a policy rather than using displayName
I would also filter on the server side instead of retrieving all device configuration policy - in a large environment it will not be efficient

@ykuijs
Copy link
Member

ykuijs commented Jan 16, 2023

If I check the policy in the Admin portal, I am able to configure these settings:
image

When I run these commands:

$getValue = Get-MgDeviceManagementDeviceConfiguration `
    -ErrorAction Stop | Where-Object `
    -FilterScript { $_.DisplayName -eq "testDSC" }

$getValue.AdditionalProperties.updateDelayPolicy

I get this result delayOSUpdateVisibility,delayAppUpdateVisibility,delayMajorOsUpdateVisibility

@William-Francillette
Copy link
Contributor

Can you check how many policies are returned by the get cmdlet
I guess the customer has 3 policies called testDSC

@ykuijs
Copy link
Member

ykuijs commented Jan 16, 2023

Is on my Test tenant and I only have one TestDSC policy 😉

@William-Francillette
Copy link
Contributor

My bad Yorick!
I just checked the payload and it's not in accordance of the doc!
updateDelayPolicy: "delayOSUpdateVisibility,delayAppUpdateVisibility,delayMajorOsUpdateVisibility" - the doc should be updated in my opinion
I get the same result than you - building a single string from the array may resolve the issue

@ykuijs
Copy link
Member

ykuijs commented Jan 16, 2023

Have updated the code. In my previous PR I made a stupid copy/paste mistake.

New fix will be included in a next PR

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
3 participants