The Test-TargetSource for resource EXOOwaMailboxPolicy returns a false (non-compliant) when it should be in 1.21.224.1
I can manually invoke-dscresource for get, set without issues. When I run test it fails stating that it was throttled by O365 due to too many open PSSessions; but this is a rabbit hole. When I run in debug mode and Start-DSCConfiguration. The Get-TargetSource does not add the fields CertificateThumbprint, ApplicationId TenantId to the returned CurrentValues hashtable and when calling Test-M365DSCParameterState to compare current values hashtable to the provided parameters which has those fields because we are using a certificate rather than a cloud account it returns a false. I copied the file, update the get-dscresource to add the fields and the issue was resolved.
39 of the 43 EXO resource are impacted with this issue which only occurs if a certificate is used. I fixed the issue by adding the below code snippet to the Get-TargetResource method.
$result = @{ . . . .
ApplicationId = $ApplicationId
CertificateThumbprint = $CertificateThumbprint
CertificatePath = $CertificatePath
CertificatePassword = $CertificatePassword
TenantId = $TenantId
}
A few resources also needed the same elements added to the $nullReturn for resources that didn't implement $nullReturn = $PSBoundParameters, but instead creates the a hashtable to return. Below is the list of impacted resources.
MSFT_EXOAddressBookPolicy MSFT_EXOAddressList MSFT_EXOAntiPhishPolicy MSFT_EXOAntiPhishRule MSFT_EXOApplicationAccessPolicy MSFT_EXOAtpPolicyForO365 MSFT_EXOAvailabilityAddressSpace MSFT_EXOAvailabilityConfig MSFT_EXOCASMailboxPlan MSFT_EXOClientAccessRule MSFT_EXODkimSigningConfig MSFT_EXOEmailAddressPolicy MSFT_EXOGlobalAddressList MSFT_EXOHostedConnectionFilterPolicy MSFT_EXOHostedContentFilterPolicy MSFT_EXOHostedContentFilterRule MSFT_EXOHostedOutboundSpamFilterPolicy MSFT_EXOInboundConnector MSFT_EXOIntraOrganizationConnector MSFT_EXOMailboxSettings MSFT_EXOMailTips MSFT_EXOMalwareFilterPolicy MSFT_EXOMalwareFilterRule MSFT_EXOManagementRole MSFT_EXOMobileDeviceMailboxPolicy MSFT_EXOOfflineAddressBook MSFT_EXOOnPremisesOrganization MSFT_EXOOrganizationConfig MSFT_EXOOrganizationRelationship MSFT_EXOOutboundConnector MSFT_EXOOwaMailboxPolicy MSFT_EXOPartnerApplication MSFT_EXOPolicyTipConfig MSFT_EXORemoteDomain MSFT_EXORoleAssignmentPolicy MSFT_EXOSafeAttachmentPolicy MSFT_EXOSafeAttachmentRule MSFT_EXOSharedMailbox * MSFT_EXOSharingPolicy
@HaloX69 we are working on a fix for next release. One thing however, is that it appears that most resources have it properly implemented for the $nullReturn. The majority of the resources you list above already are using $PSBoundParameters as the initial Hash for $nullResult. Can you confirm? Thanks