From 0725914a15cedec67578afa3d9decf3709205967 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 23 Jan 2024 09:01:47 -0500 Subject: [PATCH 1/2] EXOAddressList Fix Empty DisplayName Creation Issue --- CHANGELOG.md | 2 ++ .../MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2044de5aa..cb00d07578 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ * EXOActiveSyncDeviceAccessRule * Changed the way Identity is determined by using a combination of the QueryString and Characteristic parameters. +* EXOAddressList + * Fixed an issue trying to create a new instance when DisplayName is empty. * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 index 70aeb12826..4eaebd4662 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 @@ -430,10 +430,13 @@ function Set-TargetResource ConditionalCustomAttribute9 = $ConditionalCustomAttribute9 ConditionalDepartment = $ConditionalDepartment ConditionalStateOrProvince = $ConditionalStateOrProvince - DisplayName = $DisplayName IncludedRecipients = $IncludedRecipients Confirm = $false } + + if (-not [System.String]::IsNullOrEmpty($DisplayName)) + { + $NewAddressListParams.Add('DisplayName', $DisplayName) } New-AddressList @NewAddressListParams } From 00ef4e3dc3b765ffe1b099c3906329ff9b706f5c Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 23 Jan 2024 09:11:17 -0500 Subject: [PATCH 2/2] Update MSFT_EXOAddressList.psm1 --- .../MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 index 4eaebd4662..60468be205 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOAddressList/MSFT_EXOAddressList.psm1 @@ -434,9 +434,10 @@ function Set-TargetResource Confirm = $false } - if (-not [System.String]::IsNullOrEmpty($DisplayName)) - { - $NewAddressListParams.Add('DisplayName', $DisplayName) + if (-not [System.String]::IsNullOrEmpty($DisplayName)) + { + $NewAddressListParams.Add('DisplayName', $DisplayName) + } } New-AddressList @NewAddressListParams }