You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The resource IntuneWindowsUpdateForbusinessFeatureUpdateProfileWindows10 is responsible for making Windows 10/11 upgrades available for a subset of devices. It contains a property RolloutSettigs, that holds the following values:
OfferStartDateTimeInUTC - Start time of the update
OfferEndDateTimeInUTC - End time of the update (optional)
OfferIntervalInDays - Interval between each groups (optional)
When exporting an existing policy with a OfferStartDateTimeInUTC (and optionally end time and interval) and reimporting the configuration in another tenant, the following exception will be thrown:
The error occurs because the start time in the exported configuration is behind (current time + 2 days), which is required by the API to make the update available. This requirement cannot be changed. In my opinion, we should adjust the start time to the minimum required time and then create the policy.
Additionally, two more question arise with the handling:
What do we do if we want to create a new policy but the start and end date are in the past? Do we just let it fail? Or is checking the start / end time for a valid timespan (meaning at least end time is in the future) in Test-TargetResource a better idea, with returning True if both times are in the past? True in that case means that the policy would have no effect on the environment and thus is compliant with when no policies exist.
What is the "correct" way to check the resource in terms of timestamp matching, meaning if there is a mismatch e.g. in the start time but not in the end time? Currently, Test-TargetResource would return false, which leads to us trying to update the policy's start time. But that won't work if the start time is in the past.
I'm proposing the following resource handling changes:
Introduce the following changes to Set-TargetResource:
Creation / Update: If both start and end time are in the past, throw an error.
Creation / Update: If end time is less than start time, throw an error.
Creation: If start time is in the past but end time is in the future (by more than two days), adjust the start time to two days in the future and create the policy.
Update: If desired start time is different compared to actual but less than (current time + 2 days) and end time is different but more than 2 days in the future, keep the previous start time and only update the end time.
Introduce the following changes to Test-TargetResource:
If both start and end time are in the past or less than (current time + 2 days) with the current state being Absent, return True because creating a policy with start/end times in the past does not have any impact.
If desired start time is different compared to actual but less than (current time + 2 days) with the current state being 'Present' and end time is the same, return True because changing the start time to a date less than two days in the future is not possible.
This one is an oldie, I forgot you raised an issue for it since I also had raised another issue even earlier #3438.
Even when creating this profile through the admin portal with start and end dates it's a pain in the neck, lots of trial and error until you select the correct dates and it let's you save so I'm OK with all your changes.
Description of the issue
The resource
IntuneWindowsUpdateForbusinessFeatureUpdateProfileWindows10
is responsible for making Windows 10/11 upgrades available for a subset of devices. It contains a propertyRolloutSettigs
, that holds the following values:When exporting an existing policy with a
OfferStartDateTimeInUTC
(and optionally end time and interval) and reimporting the configuration in another tenant, the following exception will be thrown:The error occurs because the start time in the exported configuration is behind (current time + 2 days), which is required by the API to make the update available. This requirement cannot be changed. In my opinion, we should adjust the start time to the minimum required time and then create the policy.
Additionally, two more question arise with the handling:
Test-TargetResource
a better idea, with returningTrue
if both times are in the past?True
in that case means that the policy would have no effect on the environment and thus is compliant with when no policies exist.Test-TargetResource
would returnfalse
, which leads to us trying to update the policy's start time. But that won't work if the start time is in the past.I'm proposing the following resource handling changes:
Set-TargetResource
:Test-TargetResource
:Absent
, returnTrue
because creating a policy with start/end times in the past does not have any impact.True
because changing the start time to a date less than two days in the future is not possible.Microsoft 365 DSC Version
V1.24.417.1
Which workloads are affected
Intune
The DSC configuration
Verbose logs showing the problem
No response
Environment Information + PowerShell Version
No response
The text was updated successfully, but these errors were encountered: