diff --git a/CHANGELOG.md b/CHANGELOG.md index 933fb4e71e..581a9dfc61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ # UNRELEASED +* EXORoleGroup + * Fixes an issue where the role group wasn't getting created when members were null. + FIXES [#3217](https://github.com/microsoft/Microsoft365DSC/issues/3217) * SCProtectionAlert * Prevents extracting system rules. FIXES [#3224](https://github.com/microsoft/Microsoft365DSC/issues/3224) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXORoleGroup/MSFT_EXORoleGroup.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXORoleGroup/MSFT_EXORoleGroup.psm1 index b79ab1123a..37ef4451c2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXORoleGroup/MSFT_EXORoleGroup.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXORoleGroup/MSFT_EXORoleGroup.psm1 @@ -208,7 +208,6 @@ function Set-TargetResource $NewRoleGroupParams = @{ Name = $Name Description = $Description - Members = $Members Roles = $Roles Confirm = $false } @@ -222,6 +221,10 @@ function Set-TargetResource { Write-Verbose -Message "Role Group '$($Name)' does not exist but it should. Create and configure it." # Create Role Group + if ($Members.Length -gt 0) + { + $NewRoleGroupParams.Add("Members", $Members) + } New-RoleGroup @NewRoleGroupParams } # CASE: Role Group exists but it shouldn't;