Skip to content

Commit

Permalink
Merge pull request #5186 from NikCharlebois/TeamsUpgradeSettings
Browse files Browse the repository at this point in the history
TeamsUpgradePolicy - Added support for tenant wide
  • Loading branch information
NikCharlebois authored Oct 15, 2024
2 parents ce0c78d + 9cd3671 commit 741128b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
* Initial release.
* PPPowerAppPolicyUrlPatterns
* Initial release.
* TeamsUpgradePolicy
* Added support for tenant wide changes using the * value for users.
FIXES [#5174](https://github.com/microsoft/Microsoft365DSC/issues/5174)
* M365DSCDRGUtil
* Fixes an issue for the handling of skipped one-property elements in the
Settings Catalog. FIXES [#5086](https://github.com/microsoft/Microsoft365DSC/issues/5086)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,22 @@ function Set-TargetResource
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftTeams' `
-InboundParameters $PSBoundParameters

foreach ($user in $Users)
if ($Identity -eq 'Global' -and $Users.Length -eq 1 -and $Users[0] -eq '*')
{
Write-Verbose -Message "Granting TeamsUpgradePolicy {$Identity} to User {$user} with MigrateMeetingsToTeams=$MigrateMeetingsToTeams"
Grant-CsTeamsUpgradePolicy -PolicyName $Identity -Identity $user -MigrateMeetingsToTeams:$MigrateMeetingsToTeams
Write-Verbose -Message "Granting TeamsUpgradePolicy {$Identity} to all Users with MigrateMeetingsToTeams=$MigrateMeetingsToTeams"
Grant-CsTeamsUpgradePolicy -PolicyName $Identity `
-MigrateMeetingsToTeams:$MigrateMeetingsToTeams `
-Global
}
else
{
foreach ($user in $Users)
{
Write-Verbose -Message "Granting TeamsUpgradePolicy {$Identity} to User {$user} with MigrateMeetingsToTeams=$MigrateMeetingsToTeams"
Grant-CsTeamsUpgradePolicy -PolicyName $Identity `
-Identity $user `
-MigrateMeetingsToTeams:$MigrateMeetingsToTeams
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class MSFT_TeamsUpgradePolicy : OMI_BaseResource
{
[Key, Description("Identity of the Teams Upgrade Policy.")] String Identity;
[Write, Description("List of users that will be granted the Upgrade Policy to.")] String Users[];
[Write, Description("List of users that will be granted the Upgrade Policy to. Use value * to apply the policy globally.")] String Users[];
[Write, Description("Specifies whether to move existing Skype for Business meetings organized by the user to Teams. This parameter can only be true if the mode of the specified policy instance is either TeamsOnly or SfBWithTeamsCollabAndMeetings, and if the policy instance is being granted to a specific user. It not possible to trigger meeting migration when granting TeamsUpgradePolicy to the entire tenant.")] Boolean MigrateMeetingsToTeams;
[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;
Expand Down

0 comments on commit 741128b

Please sign in to comment.