Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

MSFT_EXODkimSigningConfig: Unable to delete DkimSigningConfig

Open RuudGijsbers opened this issue 6 years ago • 1 comments

Details of the scenario you tried and the problem that is occurring

We created a config file where we want to make sure that the DkimSigningConfig for one specific domain is removed/doesn't exist.

Verbose logs showing the problem

2020-10-14T07:21:33.9537947Z VERBOSE: [fv-az561]: LCM: [ Start Resource ] [[EXODkimSigningConfig]domain-com] 2020-10-14T07:21:33.9708684Z VERBOSE: [fv-az561]: LCM: [ Start Test ] [[EXODkimSigningConfig]domain-com] 2020-10-14T07:21:33.9750179Z VERBOSE: [fv-az561]: [[EXODkimSigningConfig]domain-com] Testing configuration of 2020-10-14T07:21:33.9750906Z DkimSigningConfig for domain.com 2020-10-14T07:21:33.9756836Z VERBOSE: [fv-az561]: [[EXODkimSigningConfig]domain-com] Getting configuration of 2020-10-14T07:21:33.9757405Z DkimSigningConfig for domain.com 2020-10-14T07:21:41.9898867Z VERBOSE: [fv-az561]: [[EXODkimSigningConfig]domain-com] Global ExchangeOnlineSession status: 2020-10-14T07:21:42.2461330Z VERBOSE: [fv-az561]: [[EXODkimSigningConfig]domain-com] Found DkimSigningConfig domain.com 2020-10-14T07:21:42.2469423Z VERBOSE: [fv-az561]: [[EXODkimSigningConfig]domain-com] Get-TargetResource Result: 2020-10-14T07:21:42.2470233Z AdminDisplayName=; BodyCanonicalization=Relaxed; Enabled=False; Ensure=Present; 2020-10-14T07:21:42.2470876Z GlobalAdminAccount=System.Management.Automation.PSCredential; HeaderCanonicalization=Relaxed; Identity=domain.com; 2020-10-14T07:21:42.2471343Z KeySize=1024 2020-10-14T07:21:42.2483055Z VERBOSE: [fv-az561]: [[EXODkimSigningConfig]domain-com] Current Values: AdminDisplayName=; 2020-10-14T07:21:42.2483943Z BodyCanonicalization=Relaxed; Enabled=False; Ensure=Present; 2020-10-14T07:21:42.2484528Z GlobalAdminAccount=System.Management.Automation.PSCredential; HeaderCanonicalization=Relaxed; Identity=domain.com; 2020-10-14T07:21:42.2485201Z KeySize=1024 2020-10-14T07:21:42.2485848Z VERBOSE: [fv-az561]: [[EXODkimSigningConfig]domain-com] Target Values: AdminDisplayName=; 2020-10-14T07:21:42.2486571Z BodyCanonicalization=Relaxed; Enabled=False; Ensure=Absent; 2020-10-14T07:21:42.2487108Z GlobalAdminAccount=System.Management.Automation.PSCredential; HeaderCanonicalization=Relaxed; Identity=domain.com; 2020-10-14T07:21:42.2487546Z KeySize=1024; Verbose=True 2020-10-14T07:21:43.1454573Z VERBOSE: [fv-az561]: [[EXODkimSigningConfig]domain-com] Test-TargetResource returned False 2020-10-14T07:21:43.1464518Z VERBOSE: [fv-az561]: LCM: [ End Test ] [[EXODkimSigningConfig]domain-com] in 9.1750 seconds. 2020-10-14T07:21:43.1465271Z VERBOSE: [fv-az561]: LCM: [ Start Set ] [[EXODkimSigningConfig]domain-com] 2020-10-14T07:21:43.1557097Z VERBOSE: [fv-az561]: [[EXODkimSigningConfig]domain-com] Setting configuration of 2020-10-14T07:21:43.1557861Z DkimSigningConfig for domain.com 2020-10-14T07:21:51.6343968Z VERBOSE: [fv-az561]: [[EXODkimSigningConfig]domain-com] Removing DkimSigningConfig 2020-10-14T07:21:51.6344792Z domain.com 2020-10-14T07:21:52.2336908Z The term 'Remove-DkimSigningConfig' is not recognized as the name of a cmdlet, function, script file, or operable 2020-10-14T07:21:52.2338659Z program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. 2020-10-14T07:21:52.2339798Z + CategoryInfo : ObjectNotFound: (Remove-DkimSigningConfig:) [], CimException 2020-10-14T07:21:52.2341105Z + FullyQualifiedErrorId : CommandNotFoundException 2020-10-14T07:21:52.2341971Z + PSComputerName : localhost 2020-10-14T07:21:52.2343538Z
2020-10-14T07:21:52.2355513Z VERBOSE: [fv-az561]: LCM: [ End Set ] [[EXODkimSigningConfig]domain-com] in 9.0730 seconds. 2020-10-14T07:21:52.2366973Z The PowerShell DSC resource '[EXODkimSigningConfig]domain-com' with SourceInfo 2020-10-14T07:21:52.2368198Z 'D:\a\1\s\ExchangeOnline\ExchangeOnline.ps1::323::13::EXODkimSigningConfig' threw one or more non-terminating errors 2020-10-14T07:21:52.2369342Z while running the Set-TargetResource functionality. These errors are logged to the ETW channel called 2020-10-14T07:21:52.2370529Z Microsoft-Windows-DSC/Operational. Refer to this channel for more details. 2020-10-14T07:21:52.2371499Z + CategoryInfo : InvalidOperation: (:) [], CimException 2020-10-14T07:21:52.2372444Z + FullyQualifiedErrorId : NonTerminatingErrorFromProvider 2020-10-14T07:21:52.2373499Z + PSComputerName : localhost

Suggested solution to the issue

After a short search, it looks like the Remove-DkimSigningConfig cmdlet is not available anymore. It looks like you can only disable the config. A solution could be to remove the Absence option for this resource

The DSC configuration that is used to reproduce the issue (as detailed as possible)

# insert configuration here
EXODkimSigningConfig domain-com
            {
                AdminDisplayName       = "";
                BodyCanonicalization   = "Relaxed";
                Enabled                = $False;
                Ensure                 = "Absent";
                GlobalAdminAccount     = $Credsglobaladmin;
                HeaderCanonicalization = "Relaxed";
                Identity               = "domain.com";
                KeySize                = 1024;
            }

#### The operating system the target node is running
We run the configuration within Azure DevOps pipeline on a Microsoft Hosted Agent (Windows server 2019). If you need additional information, don't hesitate to contact me.

#### Version of the DSC module that was used ('dev' if using current dev branch)
We use version 1.20.1007.1

RuudGijsbers avatar Oct 14 '20 08:10 RuudGijsbers

This has been fixed in a recent release of the solution.

NikCharlebois avatar Dec 21 '21 17:12 NikCharlebois