dsccommunity/ExchangeDsc

ExchExchangeCertificate / ExchOutlookAnywhere Resources not Idempotent

JonMWatson opened this issue · 1 comments

Problem description

Test results return actual services assigned to certificate as null in spite of the fact that the certificate is assigned services.

Verbose logs

�[0m    �[32mAn LCM method call arrived from computer MAILSERVER with user sid S-1-5-18.
�[0m    �[32m[MAILSERVER]: LCM:  [ Start  Test     ]  [[ExchExchangeCertificate]DirectResourceAccess]
�[0m    �[32m[MAILSERVER]:                            [[ExchExchangeCertificate]DirectResourceAccess] Entering function 'Test-TargetResource'. Notable parameters: Thumbprint = 'CERT_THUMBPRINT_HERE'
�[0m    �[32m[MAILSERVER]:                            [[ExchExchangeCertificate]DirectResourceAccess] Reusing existing Remote PowerShell Session to Exchange
�[0m    �[32m[MAILSERVER]:                            [[ExchExchangeCertificate]DirectResourceAccess] Importing the ExchangeDsc Remote PowerShell Module.
�[0m    �[32m[MAILSERVER]:                            [[ExchExchangeCertificate]DirectResourceAccess] Removing the imported "Get-TransportAgent" function.
�[0m    �[32m[MAILSERVER]:                            [[ExchExchangeCertificate]DirectResourceAccess] Loading module from path 'C:\WINDOWS\TEMP\DSCExchangeModule\DSCExchangeModule.psm1'.
�[0m    �[32m[MAILSERVER]:                            [[ExchExchangeCertificate]DirectResourceAccess] Importing function 'Get-ExchangeCertificate'.
�[0m    �[32m[MAILSERVER]:                            [[ExchExchangeCertificate]DirectResourceAccess] Invalid setting 'Services'. Expected value: 'IIS POP IMAP SMTP'. Actual value: ''
�[0m    �[32m[MAILSERVER]: LCM:  [ End    Test     ]  [[ExchExchangeCertificate]DirectResourceAccess] False in 1.2650 seconds.
�[0m    �[32m[MAILSERVER]: LCM:  [ End    Set      ]    in  1.3810 seconds.

---

�[0m    �[32m[MAILSERVER]: LCM:  [ Start  Test     ]  [[ExchOutlookAnywhere]DirectResourceAccess]
�[0m    �[32m[MAILSERVER]:                            [[ExchOutlookAnywhere]DirectResourceAccess] Entering function 'Test-TargetResource'. Notable parameters: Identity = 'MAILSERVER\Rpc (Default Web Site)'
�[0m    �[32m[MAILSERVER]:                            [[ExchOutlookAnywhere]DirectResourceAccess] Reusing existing Remote PowerShell Session to Exchange
�[0m    �[32m[MAILSERVER]:                            [[ExchOutlookAnywhere]DirectResourceAccess] Importing the ExchangeDsc Remote PowerShell Module.
�[0m    �[32m[MAILSERVER]:                            [[ExchOutlookAnywhere]DirectResourceAccess] Removing the imported "Get-MapiVirtualDirectory" function.
�[0m    �[32m[MAILSERVER]:                            [[ExchOutlookAnywhere]DirectResourceAccess] Loading module from path 'C:\WINDOWS\TEMP\DSCExchangeModule\DSCExchangeModule.psm1'.
�[0m    �[32m[MAILSERVER]:                            [[ExchOutlookAnywhere]DirectResourceAccess] Importing function 'Get-OutlookAnywhere'.
�[0m    �[32m[MAILSERVER]:                            [[ExchOutlookAnywhere]DirectResourceAccess] Invalid setting 'InternalHostname'. Expected value: 'mail.contoso.org'. Actual value: ''
�[0m    �[32m[MAILSERVER]:                            [[ExchOutlookAnywhere]DirectResourceAccess] Invalid setting 'ExternalHostname'. Expected value: 'mail.contoso.org'. Actual value: ''
�[0m    �[32m[MAILSERVER]: LCM:  [ End    Test     ]  [[ExchOutlookAnywhere]DirectResourceAccess] False in 1.0290 seconds.
�[0m    �[32m[MAILSERVER]: LCM:  [ End    Set      ]    in  1.1460 seconds.

DSC configuration

DSC is being called by the chef resource.

Suggested solution

I have reviewed the code for the test and have not been able to find any solution.

Operating system the target node is running

OsName               : Microsoft Windows Server 2019 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Exchange Server edition and version the target node is running

ServerRole  Edition AdminDisplayVersion
----------  ------- -------------------
   Mailbox Standard Version 15.2 (Build 1118.7)

PowerShell version and build the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.17763.3770
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.17763.3770}
BuildVersion                   10.0.17763.3770
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

ExchangeDsc version

Name        Version Path
----        ------- ----
ExchangeDsc 2.0.0   C:\Program Files\WindowsPowerShell\Modules\ExchangeDsc\2.0.0\ExchangeDsc.psd1

After further testing in additional environments, I found that the issue must not be the resource but the environment.