Skip to content

EXOCASMailboxPlan: Error Handling Issues #6774

@SNikalaichyk

Description

@SNikalaichyk

Description of the issue

The EXOCASMailboxPlan resource reports false drift due to multiple error handling issues.

Discovered Issues

  1. EXOCASMailboxPlan\Test-TargetResource calls M365DSCUtil\Test-M365DSCTargetResource without error handling
  2. M365DSCUtil\Test-M365DSCTargetResource calls EXOCASMailboxPlan\Get-TargetResource without error handling
  3. EXOCASMailboxPlan\Get-TargetResource:
    • Calls Get-CASMailboxPlan with -ErrorAction SilentlyContinue, suppressing failures such as timeouts
    • Caught exceptions are logged but not propagated, effectively suppressing them
    • Default output (Ensure=Absent) is returned when failures are suppressed

Microsoft 365 DSC Version

1.25.1203.2

Which workloads are affected

Exchange Online

The DSC configuration

N/A

Verbose logs showing the problem

Execution log:

TimeStamp MessageBody
2025-11-18 03:32:53.700 [LCM-M365DSC]: LCM: [ Start Resource ] [[EXOCASMailboxPlan]ExchangeOnlineEssentials]
2025-11-18 03:32:53.700 [LCM-M365DSC]: LCM: [ Start Test ] [[EXOCASMailboxPlan]ExchangeOnlineEssentials]
2025-11-18 03:32:53.700 [LCM-M365DSC]: [[EXOCASMailboxPlan]ExchangeOnlineEssentials] Testing configuration of CASMailboxPlan for ExchangeOnlineEssentials
2025-11-18 03:32:53.700 [LCM-M365DSC]: [[EXOCASMailboxPlan]ExchangeOnlineEssentials] Getting configuration of CASMailboxPlan for ExchangeOnlineEssentials
2025-11-18 03:32:54.887 [LCM-M365DSC]: [[EXOCASMailboxPlan]ExchangeOnlineEssentials] MailboxPlan ExchangeOnlineEssentials does not exist.
2025-11-18 03:33:52.929 <M365DSCEvent><ConfigurationDrift Source="MSFT_EXOCASMailboxPlan" TenantId="contoso.onmicrosoft.com" LCMState="ConsistencyCheck">REDACTED</ConfigurationDrift></M365DSCEvent>
2025-11-18 03:33:55.146 This event indicates that a non-terminating error was thrown when DSCEngine was executing Test-TargetResource on MSFT_EXOCASMailboxPlan DSC resource. FullyQualifiedErrorId is Microsoft.PowerShell.Commands.WriteErrorException,Write-ErrorMessage. Error Message is A server side error has occurred because of which the operation could not be completed. Please try again after some time. If the problem still persists, please reach out to MS support..
2025-11-18 03:33:55.146 [LCM-M365DSC]: [[EXOCASMailboxPlan]ExchangeOnlineEssentials] CASMailboxPlan ExchangeOnlineEssentials does not exist.
2025-11-18 03:33:55.146 [LCM-M365DSC]: [[EXOCASMailboxPlan]ExchangeOnlineEssentials] Current Values: Identity=ExchangeOnlineEssentials
2025-11-18 03:33:55.146 [LCM-M365DSC]: [[EXOCASMailboxPlan]ExchangeOnlineEssentials] Target Values: ActiveSyncEnabled=True Identity=ExchangeOnlineEssentials ImapEnabled=False OwaMailboxPolicy=OwaMailboxPolicy-Default PopEnabled=False REDACTED
2025-11-18 03:33:55.146 [LCM-M365DSC]: [[EXOCASMailboxPlan]ExchangeOnlineEssentials] Test-TargetResource returned False
2025-11-18 03:33:55.146 [LCM-M365DSC]: LCM: [ End Test ] [[EXOCASMailboxPlan]ExchangeOnlineEssentials] in 60.5280 seconds.
2025-11-18 03:33:55.146 This event indicates that failure happens when LCM is processing the configuration. Error Id is 1. Error Detail is The SendConfigurationApply function did not succeed.. Resource Id is [EXOCASMailboxPlan]ExchangeOnlineEssentials and Source Info is REDACTED. Error Message is The PowerShell DSC resource '[EXOCASMailboxPlan]ExchangeOnlineEssentials' with SourceInfo 'REDACTED' threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC\Operational. Refer to this channel for more details..
2025-11-18 03:33:55.146 MIResult: 1 Error Message: The PowerShell DSC resource '[EXOCASMailboxPlan]ExchangeOnlineEssentials' with SourceInfo 'REDACTED' threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC\Operational. Refer to this channel for more details. Message ID: NonTerminatingErrorFromProvider Error Category: 7 Error Code: 1 Error Type: MI

Configuration drift event:

<M365DSCEvent>
    <ConfigurationDrift Source="MSFT_EXOCASMailboxPlan" TenantId="contoso.onmicrosoft.com" LCMState="ConsistencyCheck">
        <ParametersNotInDesiredState>
            <Param Name="PopEnabled">
                <CurrentValue></CurrentValue>
                <DesiredValue>False</DesiredValue>
            </Param>
            <Param Name="ImapEnabled">
                <CurrentValue></CurrentValue>
                <DesiredValue>False</DesiredValue>
            </Param>
            <Param Name="OwaMailboxPolicy">
                <CurrentValue></CurrentValue>
                <DesiredValue>OwaMailboxPolicy-Default</DesiredValue>
            </Param>
            <Param Name="ActiveSyncEnabled">
                <CurrentValue></CurrentValue>
                <DesiredValue>True</DesiredValue>
            </Param>
        </ParametersNotInDesiredState>
    </ConfigurationDrift>
    <DesiredValues>
        <Param Name ="Identity">ExchangeOnlineEssentials</Param>
        <Param Name ="ActiveSyncEnabled">True</Param>
        <Param Name ="ImapEnabled">False</Param>
        <Param Name ="OwaMailboxPolicy">OwaMailboxPolicy-Default</Param>
        <Param Name ="PopEnabled">False</Param>
        <!-- REDACTED -->
    </DesiredValues>
    <CurrentValues>
        <Param Name ="Identity">ExchangeOnlineEssentials</Param>
    </CurrentValues>
</M365DSCEvent>

Environment Information + PowerShell Version

N/A

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions