microsoft / Microsoft365DSC

Manages, configures, extracts and monitors Microsoft 365 tenant configurations
https://aka.ms/M365DSC
MIT License
1.6k stars 498 forks source link

Exchange Transport Rules cannot be restored/retrieved from snapshots/configurations taken #3929

Closed jagatjb closed 10 months ago

jagatjb commented 11 months ago

Description of the issue

The issue is You can't create or update DLP-related mail flow rules. See https://aka.ms/NoDLPinETRs. If the below Conditions are present, then I am not able to restore a deleted Exchange transport rule back from a previous snapshot.

MessageContainsDataClassifications (message contains sensitive information) ExceptIfMessageContainsDataClassifications HasSenderOverride (sender has overridden the Policy Tip) ExceptIfHasSenderOverride

So I have updated the module, and then taken a snapshot, deleted an exchange transport rule. Then modified that snapshot to add only thesingle exchange transport rule and converted to .mof file and deployed it. I got the above-mentioned error. Last I checked on 11th November, it worked fine, ie, restoring a deleted exchange transport rule.

Microsoft 365 DSC Version

1.23.1115.1

Which workloads are affected

Exchange Online

The DSC configuration

Exchange Transport Rules

Verbose logs showing the problem

VERBOSE: [servername]:                            [[EXOTransportRule]EXOTransportRule-Test_DSC] Returning precomputed version info: 3.4.0
VERBOSE: [servername]:                            [[EXOTransportRule]EXOTransportRule-Test_DSC] POST
https://outlook.office365.com/adminapi/beta/c6263649-6ff4-4999-9867-047c3681988c/InvokeCommand with -1-byte payload
VERBOSE: [servername]:                            [[EXOTransportRule]EXOTransportRule-Test_DSC] Query 1 failed.
You can't create or update DLP-related mail flow rules. See https://aka.ms/NoDLPinETRs.
    + CategoryInfo          : NotSpecified: (:) [], CimException
    + FullyQualifiedErrorId : [Server=SJ2PR20MB7107,RequestId=1ee3d2e6-a9e2-204c-dd3b-79e44e3cd0d6,TimeStamp=Wed, 22 Nov 2023 15:31:03 GMT],Write-ErrorMessage
    + PSComputerName        : localhost

VERBOSE: [servername]: LCM:  [ End    Set      ]  [[EXOTransportRule]EXOTransportRule-Test_DSC]  in 3.9060 seconds.
The PowerShell DSC resource '[EXOTransportRule]EXOTransportRule-Test_DSC' with SourceInfo 'F:\M365DSC\etrrestore.ps1::17::9::EXOTransportRule' threw one or more non-terminating
errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : localhost

VERBOSE: [servername]: LCM:  [ End    Set      ]
The SendConfigurationApply function did not succeed.
    + CategoryInfo          : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 1
    + PSComputerName        : localhost

VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 61.879 seconds

Environment Information + PowerShell Version

NA
mhincapie commented 11 months ago

@jagatjb Just wanted to let you know that we had the same problem. What we did was removed the following properties from the resources and it fixed the issue. Even though that they are set to $False

HasSenderOverride
ExceptIfHasSenderOverride

Let us know if that works for you also.

jagatjb commented 11 months ago

@jagatjb Just wanted to let you know that we had the same problem. What we did was removed the following properties from the resources and it fixed the issue. Even though that they are set to $False

HasSenderOverride
ExceptIfHasSenderOverride

Let us know if that works for you also.

Yes, this works. And as of now this is the workaround until it's permanently fixed.