Skip to content

EXODistributionGroup: Configuration Drift Loop - GUID vs SMTP Address Mismatch #6769

@SNikalaichyk

Description

@SNikalaichyk

Description of the issue

Issue

EXODistributionGroup returns GUIDs instead of SMTP addresses because Get-DistributionGroup cmdlet is not using the -Include*WithDisplayNames switch parameters.

Root Cause

The module calls the Get-DistributionGroup cmdlet without the following parameters:

  • -IncludeAcceptMessagesOnlyFromDLMembersWithDisplayNames
  • -IncludeAcceptMessagesOnlyFromSendersOrMembersWithDisplayNames
  • -IncludeAcceptMessagesOnlyFromWithDisplayNames
  • -IncludeBypassModerationFromSendersOrMembersWithDisplayNames
  • -IncludeGrantSendOnBehalfToWithDisplayNames
  • -IncludeManagedByWithDisplayNames
  • -IncludeModeratedByWithDisplayNames

This causes GUID values to be returned instead of SMTP addresses, causing repeated false positive drift detection when configuration specifies SMTP addresses.

Symptoms

Execution logs:

Found existing Distribution Group {example-group}.
Getting Distribution Group managers for example-group
Couldn't retrieve manager recipient {47eecb0e-2d63-4cbf-aa45-2d766912b00c}
Couldn't retrieve manager recipient {8fbe075a-c43d-4b8d-a98d-3300b1b5b613}
Couldn't retrieve manager recipient {695ef81f-a7d0-4a03-8e51-7d5a995fa435}

Configuration drift event log:

<M365DSCEvent>
    <ConfigurationDrift Source="MSFT_EXODistributionGroup" TenantId="contoso.onmicrosoft.com" LCMState="ConsistencyCheck">
        <ParametersNotInDesiredState>
            <Param Name="ManagedBy">
                <CurrentValue></CurrentValue>
                <DesiredValue>[email protected] [email protected] [email protected]</DesiredValue>
            </Param>
        </ParametersNotInDesiredState>
    </ConfigurationDrift>
    <DesiredValues>
        <!-- Truncated -->
    </DesiredValues>
    <CurrentValues>
        <!-- Truncated -->
    </CurrentValues>
</M365DSCEvent>

Solution

Update EXODistributionGroup to specify -Include*WithDisplayNames parameters when calling Get-DistributionGroup.

Reference: Get-DistributionGroup documentation

Impact

  • Repeated false positive drift detections
  • Unnecessary remediation attempts
  • Configuration management instability
  • Increased operational overhead

Related Issues

This issue is similar to the previously resolved EXOGroupSettings: Configuration Drift Loop - GUID vs SMTP Address Mismatch · Issue #6676, which affected the EXOGroupSettings resource with the Get-UnifiedGroup cmdlet.

Microsoft 365 DSC Version

1.25.1203.2

Which workloads are affected

Exchange Online

The DSC configuration

Verbose logs showing the problem

Environment Information + PowerShell Version

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions