diff --git a/CHANGELOG.md b/CHANGELOG.md index 8679ac76c6..a417b20b79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,6 +105,9 @@ FIXES [#3066](https://github.com/microsoft/Microsoft365DSC/issues/3066) * TeamsMeetingPolicy * [BREAKING CHANGE] Remove deprecated parameter RecordingStorageMode +* TeamsUpdateManagementPolicy + * Added support for the new UseNewTeamsClient parameter. + FIXES [#3062](https://github.com/microsoft/Microsoft365DSC/issues/3062) * DRG * Various fixes * Cleanup generated code diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpdateManagementPolicy/MSFT_TeamsUpdateManagementPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpdateManagementPolicy/MSFT_TeamsUpdateManagementPolicy.psm1 index a23e3e6132..8aa7f855cc 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpdateManagementPolicy/MSFT_TeamsUpdateManagementPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpdateManagementPolicy/MSFT_TeamsUpdateManagementPolicy.psm1 @@ -38,6 +38,10 @@ function Get-TargetResource [System.String] $UpdateTimeOfDay, + [Parameter()] + [System.Boolean] + $UseNewTeamsClient, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] @@ -98,6 +102,7 @@ function Get-TargetResource AllowPublicPreview = $policy.AllowPublicPreview UpdateDayOfWeek = $policy.UpdateDayOfWeek UpdateTime = $policy.UpdateTime + UseNewTeamsClient = $policy.UseNewTeamsClient Ensure = 'Present' Credential = $Credential ApplicationId = $ApplicationId @@ -162,6 +167,10 @@ function Set-TargetResource [System.String] $UpdateTimeOfDay, + [Parameter()] + [System.Boolean] + $UseNewTeamsClient, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] @@ -274,6 +283,10 @@ function Test-TargetResource [System.String] $UpdateTimeOfDay, + [Parameter()] + [System.Boolean] + $UseNewTeamsClient, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpdateManagementPolicy/MSFT_TeamsUpdateManagementPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpdateManagementPolicy/MSFT_TeamsUpdateManagementPolicy.schema.mof index 5a15f169b7..8cfa88cfa7 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpdateManagementPolicy/MSFT_TeamsUpdateManagementPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUpdateManagementPolicy/MSFT_TeamsUpdateManagementPolicy.schema.mof @@ -9,6 +9,7 @@ class MSFT_TeamsUpdateManagementPolicy : OMI_BaseResource [Write, Description("Determines the day of week to perform the updates. Value shoud be between 0 and 6.")] UInt32 UpdateDayOfWeek; [Write, Description("Determines the time of day to perform the updates. Must be a valid HH:MM format string with leading 0. For instance 08:30.")] String UpdateTime; [Write, Description("Determines the time of day to perform the updates. Accepts a DateTime as string. Only the time will be considered.")] String UpdateTimeOfDay; + [Write, Description("Determines whether or not users will use the new Teams client.")] Boolean UseNewTeamsClient; [Write, Description("Present ensures the policy exists, absent ensures it is removed."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; [Write, Description("Credentials of the Teams Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; diff --git a/Modules/Microsoft365DSC/Examples/Resources/TeamsUpdateManagementPolicy/1-CreateNewPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/TeamsUpdateManagementPolicy/1-CreateNewPolicy.ps1 index 6164cc3998..b436889542 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/TeamsUpdateManagementPolicy/1-CreateNewPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/TeamsUpdateManagementPolicy/1-CreateNewPolicy.ps1 @@ -25,6 +25,7 @@ Configuration Example UpdateDayOfWeek = 1; UpdateTime = "18:00"; UpdateTimeOfDay = "2022-05-06T18:00:00"; + UseNewTeamsClient = $True } } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpdateManagementPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpdateManagementPolicy.Tests.ps1 index 490c6bffa8..a1fd23aa7c 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpdateManagementPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsUpdateManagementPolicy.Tests.ps1 @@ -26,7 +26,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { $Credential = New-Object System.Management.Automation.PSCredential ('tenantadmin@mydomain.com', $secpasswd) $DateTimeValue = [System.DateTime]::Parse("2022-12-08 6:00:00PM") $Global:PartialExportFileName = 'c:\TestPath' - + Mock -CommandName Save-M365DSCPartialExport -MockWith { } @@ -60,6 +60,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { UpdateDayOfWeek = 1 UpdateTime = '18:00' UpdateTimeOfDay = '6:00 PM' + UseNewTeamsClient = $True Ensure = 'Present' Credential = $Credential } @@ -94,6 +95,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { UpdateDayOfWeek = 1 UpdateTime = '18:00' UpdateTimeOfDay = '6:00 PM' + UseNewTeamsClient = $True Ensure = 'Present' Credential = $Credential } @@ -108,6 +110,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { UpdateDayOfWeek = 3; #Drift UpdateTime = '18:00' UpdateTimeOfDay = $DateTimeValue + UseNewTeamsClient = $True } } } @@ -138,6 +141,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { UpdateDayOfWeek = 1 UpdateTime = '18:00' UpdateTimeOfDay = '6:00 PM' + UseNewTeamsClient = $True Ensure = 'Present' Credential = $Credential } @@ -152,6 +156,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { UpdateDayOfWeek = 1 UpdateTime = '18:00' UpdateTimeOfDay = $DateTimeValue + UseNewTeamsClient = $True } } } @@ -183,6 +188,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { UpdateDayOfWeek = 1 UpdateTime = '18:00' UpdateTimeOfDay = $DateTimeValue + UseNewTeamsClient = $True } } } @@ -219,6 +225,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { UpdateDayOfWeek = 1 UpdateTime = '18:00' UpdateTimeOfDay = $DateTimeValue + UseNewTeamsClient = $True } } }