Skip to content

Commit

Permalink
Merge pull request microsoft#4978 from tayhall/myDSCDev
Browse files Browse the repository at this point in the history
Update MSFT_EXORoleGroup.psm1
  • Loading branch information
ykuijs authored Aug 23, 2024
2 parents 1ec7623 + a9829fa commit 00ccc6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# UNRELEASED


* AADConditionalAccessPolicy
* Fixing issue where the resource crashed when trying to retrieve groups
and users from Entra ID which no longer existed
Expand All @@ -17,6 +18,9 @@
* EXOHostedContentFilterRule
* Don't check if associated `EXOHostedContentFilterPolicy` is present
while removing resource since it's not required
* EXORoleGroup
* Fix an issue where roles that have empty members cannot be compared
FIXES [#4977] (https://github.com/microsoft/Microsoft365DSC/issues/4977)
* IntuneAccountProtectionLocalAdministratorPasswordSolutionPolicy
* Fixed issue if `PasswordComplexity` was set to 5 by allowing that value
FIXES [#4963](https://github.com/microsoft/Microsoft365DSC/issues/4963)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,14 @@ function Set-TargetResource
Remove-RoleGroup -Identity $Name -Confirm:$false -Force
}
# CASE: Role Group exists and it should, but has different member values than the desired ones
elseif ($Ensure -eq 'Present' -and $currentRoleGroupConfig.Ensure -eq 'Present' -and $null -ne (Compare-Object -ReferenceObject $($currentRoleGroupConfig.Members) -DifferenceObject $Members))
elseif ($Ensure -eq 'Present' -and $currentRoleGroupConfig.Ensure -eq 'Present' -and $null -ne (Compare-Object -ReferenceObject @($($currentRoleGroupConfig.Members) | Select-Object) -DifferenceObject @($Members | Select-Object)))
{
Write-Verbose -Message "Role Group '$($Name)' already exists, but members need updating."
Write-Verbose -Message "Updating Role Group $($Name) members with values: $(Convert-M365DscHashtableToString -Hashtable $NewRoleGroupParams)"
Update-RoleGroupMember -Identity $Name -Members $Members -Confirm:$false
}
# CASE: Role Assignment Policy exists and it should, but Role has no members as its never been set
elseif ($Ensure -eq 'Present' -and $currentRoleGroupConfig.Ensure -eq 'Present' -and $currentRoleGroupConfig.Members -eq '')
{
Write-Verbose -Message "Role Group '$($Name)' already exists, but members need updating."
Write-Verbose -Message "Updating Role Group $($Name) members with values: $(Convert-M365DscHashtableToString -Hashtable $NewRoleGroupParams)"
Expand Down

0 comments on commit 00ccc6e

Please sign in to comment.