ExchAcceptedDomain: Test-TargetResource for MakeDefault Parameter Failing
Opened this issue · 1 comments
nicholasrodriguez commented
Problem description
With the MakeDefault parameter defined the Test-TargetResource responds with the following and fails to apply the setting or verify using Test-DscConfiguration
Invalid setting 'MakeDefault'. Expected value: True. Actual value:
Verbose logs
VERBOSE: [<HOSTNAME>]: LCM: [ Start Resource ] [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>]
VERBOSE: [<HOSTNAME>]: LCM: [ Start Test ] [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>]
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Testing the Exchange accepted domain settings
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Entering function 'Test-TargetResource'. Notable parameters: Identity = 'example.com'
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Getting the Exchange Accepted Domains List
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Entering function 'Get-TargetResource'. Notable parameters: Identity = 'example.com'
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Reusing existing Remote PowerShell Session to Exchange
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Importing the ExchangeDsc Remote PowerShell Module.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Removing the imported "Get-SendConnector" function.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Removing the imported "Get-ADPermission" function.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Loading module from path 'C:\Windows\TEMP\DSCExchangeModule\DSCExchangeModule.psm1'.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Importing function 'Get-AcceptedDomain'.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Invalid setting 'MakeDefault'. Expected value: True. Actual value:
VERBOSE: [<HOSTNAME>]: LCM: [ End Test ] [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] in 1.0590 seconds.
VERBOSE: [<HOSTNAME>]: LCM: [ Start Set ] [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>]
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Setting the Exchange accepted domain settings
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Entering function 'Set-TargetResource'. Notable parameters: Identity = 'example.com'
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Getting the Exchange Accepted Domains List
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Entering function 'Get-TargetResource'. Notable parameters: Identity = 'example.com'
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Reusing existing Remote PowerShell Session to Exchange
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Importing the ExchangeDsc Remote PowerShell Module.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Removing the imported "Get-AcceptedDomain" function.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Loading module from path 'C:\Windows\TEMP\DSCExchangeModule\DSCExchangeModule.psm1'.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Importing function 'Get-AcceptedDomain'.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Reusing existing Remote PowerShell Session to Exchange
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Importing the ExchangeDsc Remote PowerShell Module.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Removing the imported "Get-AcceptedDomain" function.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Loading module from path 'C:\Windows\TEMP\DSCExchangeModule\DSCExchangeModule.psm1'.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Importing function 'Get-AcceptedDomain'.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Importing function 'New-AcceptedDomain'.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Importing function 'Remove-AcceptedDomain'.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Importing function 'Set-AcceptedDomain'.
VERBOSE: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] Accepted domain example.com not compliant. Setting the desired attributes.
WARNING: [<HOSTNAME>]: [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] The command completed successfully but no settings of 'example.com' have been modified.
VERBOSE: [<HOSTNAME>]: LCM: [ End Set ] [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>] in 0.9480 seconds.
VERBOSE: [<HOSTNAME>]: LCM: [ End Resource ] [[ExchAcceptedDomain]...Build-Role-Exchange-as-<HOSTNAME>]
DSC configuration
ExchAcceptedDomain "Configure-Exchange-Accepted-Domain-On-$NodeName"
{
DomainName = "example.com"
Credential = $DomainCreds
Ensure = 'Present'
DomainType = 'Authoritative'
Name = "example.com"
MakeDefault = $True
}
Suggested solution
None
Operating system the target node is running
Windows 2022
Exchange Server edition and version the target node is running
2019 CU13
PowerShell version and build the target node is running
5.1
ExchangeDsc version
2.0.0
nicholasrodriguez commented
I've just run some further tests, it does apply the setting but the Test-Resource function is broken so running a Test-DscConfiguration fails.