Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AADGroup: Group owners are removed (while they shouldn't if the owners property is not present in the dsc config) #4390

Closed
bartvermeersch opened this issue Feb 29, 2024 · 1 comment · Fixed by #4447

Comments

@bartvermeersch
Copy link
Contributor

Description of the issue

When specifying an AADGroup resource without specifying members and owners, existing members are retained but owners are removed for groups that already exist.

For members a check is done on the $PSBoundParameters
if ($MembershipRuleProcessingState -ne 'On' -and $PSBoundParameters.ContainsKey('Members'))

#Members
if ($MembershipRuleProcessingState -ne 'On' -and $PSBoundParameters.ContainsKey('Members'))
{
$currentMembersValue = @()
if ($currentParameters.Members.Length -ne 0)
{

For owners this check is missing on line 620:

#Owners
$currentOwnersValue = @()
if ($currentParameters.Owners.Length -gt 0)
{

I would expect
if ($PSBoundParameters.ContainsKey('Owners'))
just below line 621

Microsoft 365 DSC Version

1.24.228.1

Which workloads are affected

Azure Active Directory

The DSC configuration

AADGroup "AADGroup_TEST"
        {
            DisplayName        = "TESTGROUP"
            Description        = "TESTGROUP"
            MailNickName       = "TESTGROUP"
            MailEnabled        = $false
            SecurityEnabled    = $true
            TenantId           = $TenantId
            ApplicationId      = $ApplicationId
            CertificateThumbprint = $Thumbprint
            Ensure             = "Present"
        }

Verbose logs showing the problem

No response

Environment Information + PowerShell Version

No response

@bartvermeersch
Copy link
Contributor Author

Should be fixed by #4396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant