Skip to content

Commit

Permalink
TeamsUpgradePolicy - Added support for tenant wide
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois committed Oct 14, 2024
1 parent ce27cb8 commit 9cd3671
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 @@ -48,6 +48,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 9cd3671

Please sign in to comment.