Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSFT_EXOAddressList: You can't use customized filters and precanned filters at the same time #2194

Closed
rberghuis opened this issue Aug 18, 2022 · 1 comment · Fixed by #2248
Assignees
Labels
Bug Something isn't working Exchange Online

Comments

@rberghuis
Copy link

rberghuis commented Aug 18, 2022

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

Using the AddressList DscResource, it produces an error due to the use of a combination of filters. However, the provided input is valid. The issue seems to reside in the 'empty' key-value pairs of either NewAddressListParams or SetAddressListParams.

Verbose logs showing the problem

VERBOSE: [hostname]: LCM:  [ Start  Resource ]  [[EXOAddressList]AllEquipment]
VERBOSE: [hostname]: LCM:  [ Start  Test     ]  [[EXOAddressList]AllEquipment]
VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Testing Address List configuration for All Equipment
VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Getting configuration of AddressList for All Equipment
VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Found AddressList All Equipment
VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Get-TargetResource Result: 
 ApplicationId=***; CertificatePassword=***; CertificatePath=***; 
CertificateThumbprint=***; ConditionalCompany=; ConditionalCustomAttribute1=; 
ConditionalCustomAttribute10=; ConditionalCustomAttribute11=; ConditionalCustomAttribute12=; 
ConditionalCustomAttribute13=; ConditionalCustomAttribute14=; ConditionalCustomAttribute15=; 
ConditionalCustomAttribute2=; ConditionalCustomAttribute3=; ConditionalCustomAttribute4=; ConditionalCustomAttribute5=;
 ConditionalCustomAttribute6=; ConditionalCustomAttribute7=; ConditionalCustomAttribute8=; 
ConditionalCustomAttribute9=; ConditionalDepartment=; ConditionalStateOrProvince=; Credential=$null; DisplayName=All 
Equipment; Ensure=Present; IncludedRecipients=(); Name=All Equipment; RecipientFilter=((Alias -ne $null) -and 
(RecipientTypeDetails -eq 'EquipmentMailbox')); TenantId=***

VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Current Values: ApplicationId=***; 
CertificatePassword=***; CertificatePath=***; CertificateThumbprint=***; 
ConditionalCompany=; ConditionalCustomAttribute1=; ConditionalCustomAttribute10=; ConditionalCustomAttribute11=; 
ConditionalCustomAttribute12=; ConditionalCustomAttribute13=; ConditionalCustomAttribute14=; 
ConditionalCustomAttribute15=; ConditionalCustomAttribute2=; ConditionalCustomAttribute3=; 
ConditionalCustomAttribute4=; ConditionalCustomAttribute5=; ConditionalCustomAttribute6=; ConditionalCustomAttribute7=;
 ConditionalCustomAttribute8=; ConditionalCustomAttribute9=; ConditionalDepartment=; ConditionalStateOrProvince=; 
Credential=$null; DisplayName=All Equipment; Ensure=Present; IncludedRecipients=(); Name=All Equipment; 
RecipientFilter=((Alias -ne $null) -and (RecipientTypeDetails -eq 'EquipmentMailbox')); TenantId=***

VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Target Values: ApplicationId=***; 
CertificateThumbprint=***; DisplayName=All Equipment; Ensure=Present; Name=All 
Equipment; RecipientFilter=((Alias -ne $null) -and (RecipientTypeDetails -eq "EquipmentMailbox")); TenantId=***; 
Verbose=True

VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Test-TargetResource returned False
VERBOSE: [hostname]: LCM:  [ End    Test     ]  [[EXOAddressList]AllEquipment]  in 0.6110 seconds.
VERBOSE: [hostname]: LCM:  [ Start  Set      ]  [[EXOAddressList]AllEquipment]
VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Setting Address List configuration for All Equipment
VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Getting configuration of AddressList for All Equipment
VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Found AddressList All Equipment
VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Get-TargetResource Result: 
 ApplicationId=***; CertificatePassword=***; CertificatePath=***; 
CertificateThumbprint=***; ConditionalCompany=; ConditionalCustomAttribute1=; 
ConditionalCustomAttribute10=; ConditionalCustomAttribute11=; ConditionalCustomAttribute12=; 
ConditionalCustomAttribute13=; ConditionalCustomAttribute14=; ConditionalCustomAttribute15=; 
ConditionalCustomAttribute2=; ConditionalCustomAttribute3=; ConditionalCustomAttribute4=; ConditionalCustomAttribute5=;
 ConditionalCustomAttribute6=; ConditionalCustomAttribute7=; ConditionalCustomAttribute8=; 
ConditionalCustomAttribute9=; ConditionalDepartment=; ConditionalStateOrProvince=; Credential=$null; DisplayName=All 
Equipment; Ensure=Present; IncludedRecipients=(); Name=All Equipment; RecipientFilter=((Alias -ne $null) -and 
(RecipientTypeDetails -eq 'EquipmentMailbox')); TenantId=***

VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Address List 'All Equipment' already exists. Updating settings
VERBOSE: [hostname]:                            [[EXOAddressList]AllEquipment] Setting Address List 'All Equipment' 
with values: ConditionalCompany=$null; ConditionalCustomAttribute1=$null; ConditionalCustomAttribute10=$null; 
ConditionalCustomAttribute11=$null; ConditionalCustomAttribute12=$null; ConditionalCustomAttribute13=$null; 
ConditionalCustomAttribute14=$null; ConditionalCustomAttribute15=$null; ConditionalCustomAttribute2=$null; 
ConditionalCustomAttribute3=$null; ConditionalCustomAttribute4=$null; ConditionalCustomAttribute5=$null; 
ConditionalCustomAttribute6=$null; ConditionalCustomAttribute7=$null; ConditionalCustomAttribute8=$null; 
ConditionalCustomAttribute9=$null; ConditionalDepartment=$null; ConditionalStateOrProvince=$null; Confirm=False; 
DisplayName=All Equipment; Identity=All Equipment; IncludedRecipients=$null; Name=All Equipment; 
RecipientFilter=((Alias -ne $null) -and (RecipientTypeDetails -eq "EquipmentMailbox"))

##[error]Failed to start the DSC configuration. Error: You can't use customized filters and precanned filters at the same time.

Suggested solution to the issue

According to the Docs, the following are considered precanned filters:

  • IncludedRecipients
  • ConditionalCompany
  • ConditionalDepartment
  • ConditionalStateOrProvince
  • ConditionalCustomAttribute1 to ConditionalCustomAttribute15.

Suggested to avoid this all together, and update the DscResource to remove all empty KeyValue pairs. Any error then still produced might be due to the provided input, combining custom filters with precanned filters, but that's an input-error. However, I don't know if this would cause conflicts (on update) when moving from precanned to custom filters or viceversa.

($NewAddressListParams.GetEnumerator() | Where-Object { $_.Value -eq $null }) | Foreach-Object { $NewAddressListParams.Remove($_.Name) }

($SetAddressListParams.GetEnumerator() | Where-Object { $_.Value -eq $null }) | Foreach-Object { $SetAddressListParams.Remove($_.Name) }

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

Node localhost {
	EXOAddressList 'AllEquipment' {
		# Authentication details
		#Credential            = $CredsGlobalAdmin
		TenantId               = $TenantId
		ApplicationId          = $ApplicationId
		CertificateThumbprint  = $CertificateThumbprint
 
		# Settings             
		Ensure                 = "Present"
		Name                   = "All Equipment"
		DisplayName            = "All Equipment"
		RecipientFilter        = '((Alias -ne $null) -and (RecipientTypeDetails -eq "EquipmentMailbox"))'
	}
}

The operating system the target node is running

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

Version of the DSC module that was used ('dev' if using current dev branch)

1.22.713.1

@andikrueger andikrueger added Bug Something isn't working Exchange Online labels Aug 19, 2022
@andikrueger
Copy link
Collaborator

@malauter Could you have a look at this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Exchange Online
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants