From 0725914a15cedec67578afa3d9decf3709205967 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 23 Jan 2024 09:01:47 -0500 Subject: [PATCH 01/11] 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 02/11] 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 } From 0be598d4f9ac721a3719600415f3c30ca90e46f8 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 23 Jan 2024 09:37:53 -0500 Subject: [PATCH 03/11] Fixes Integration --- .../Examples/Resources/EXOAntiPhishRule/1-Create.ps1 | 3 ++- .../Examples/Resources/EXOAntiPhishRule/2-Update.ps1 | 3 ++- .../Examples/Resources/EXOCalendarProcessing/2-Update.ps1 | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 index 37d4883a0d..74b5fc789a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 @@ -12,6 +12,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAntiPhishRule 'ConfigureAntiPhishRule' @@ -25,7 +26,7 @@ Configuration Example AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("msteams_bb15d4@contoso.onmicrosoft.com") + SentToMemberOf = @("executives@c$Domain") Priority = 1 Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 index 04eaa3e3ac..65d4cb37d8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 @@ -12,6 +12,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAntiPhishRule 'ConfigureAntiPhishRule' @@ -25,7 +26,7 @@ Configuration Example AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("msteams_bb15d4@contoso.onmicrosoft.com") + SentToMemberOf = @("executives@c$Domain") Priority = 2 # Updated Property Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 index 3062e90df0..84ae10d81a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 @@ -13,9 +13,9 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXOCalendarProcessing "CalendarProcessing" { AddAdditionalResponse = $False; From eb03234e0351a575a1826857fe3b02314e621782 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 14:39:22 +0000 Subject: [PATCH 04/11] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/exchange/EXOAntiPhishRule.md | 6 ++++-- docs/docs/resources/exchange/EXOCalendarProcessing.md | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/docs/resources/exchange/EXOAntiPhishRule.md b/docs/docs/resources/exchange/EXOAntiPhishRule.md index c43ea8d007..7935d0e41f 100644 --- a/docs/docs/resources/exchange/EXOAntiPhishRule.md +++ b/docs/docs/resources/exchange/EXOAntiPhishRule.md @@ -60,6 +60,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAntiPhishRule 'ConfigureAntiPhishRule' @@ -73,7 +74,7 @@ Configuration Example AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("msteams_bb15d4@contoso.onmicrosoft.com") + SentToMemberOf = @("executives@c$Domain") Priority = 1 Ensure = "Present" Credential = $Credscredential @@ -97,6 +98,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAntiPhishRule 'ConfigureAntiPhishRule' @@ -110,7 +112,7 @@ Configuration Example AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("msteams_bb15d4@contoso.onmicrosoft.com") + SentToMemberOf = @("executives@c$Domain") Priority = 2 # Updated Property Ensure = "Present" Credential = $Credscredential diff --git a/docs/docs/resources/exchange/EXOCalendarProcessing.md b/docs/docs/resources/exchange/EXOCalendarProcessing.md index c01c29cc4d..39eb464dec 100644 --- a/docs/docs/resources/exchange/EXOCalendarProcessing.md +++ b/docs/docs/resources/exchange/EXOCalendarProcessing.md @@ -88,9 +88,9 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXOCalendarProcessing "CalendarProcessing" { AddAdditionalResponse = $False; From 59b160ba40d30f3abf34fea74e00f98019d40058 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 14:42:28 +0000 Subject: [PATCH 05/11] Updated {Create} EXO Integration Tests --- .../Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 index 80b7a3be80..0fae2ce220 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -91,7 +91,7 @@ AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("msteams_bb15d4@contoso.onmicrosoft.com") + SentToMemberOf = @("executives@c$Domain") Priority = 1 Ensure = "Present" Credential = $Credscredential From 3fee354b2abef1365513e9f2aa7c3d90a2052304 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 23 Jan 2024 09:43:12 -0500 Subject: [PATCH 06/11] Fixes --- .../Examples/Resources/EXOAntiPhishRule/1-Create.ps1 | 2 +- .../Examples/Resources/EXOAntiPhishRule/2-Update.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 index 74b5fc789a..317e746288 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 @@ -26,7 +26,7 @@ Configuration Example AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("executives@c$Domain") + SentToMemberOf = @("executives@$Domain") Priority = 1 Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 index 65d4cb37d8..b9ecd4cb39 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 @@ -26,7 +26,7 @@ Configuration Example AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("executives@c$Domain") + SentToMemberOf = @("executives@$Domain") Priority = 2 # Updated Property Ensure = "Present" Credential = $Credscredential From e5c3f3abcde401c24dc9d8cbc133be31f406a776 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 14:44:20 +0000 Subject: [PATCH 07/11] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/exchange/EXOAntiPhishRule.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/resources/exchange/EXOAntiPhishRule.md b/docs/docs/resources/exchange/EXOAntiPhishRule.md index 7935d0e41f..da1567c931 100644 --- a/docs/docs/resources/exchange/EXOAntiPhishRule.md +++ b/docs/docs/resources/exchange/EXOAntiPhishRule.md @@ -74,7 +74,7 @@ Configuration Example AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("executives@c$Domain") + SentToMemberOf = @("executives@$Domain") Priority = 1 Ensure = "Present" Credential = $Credscredential @@ -112,7 +112,7 @@ Configuration Example AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("executives@c$Domain") + SentToMemberOf = @("executives@$Domain") Priority = 2 # Updated Property Ensure = "Present" Credential = $Credscredential From 70b34162c6573163befd0b27d308f7e72e7f2483 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 14:49:24 +0000 Subject: [PATCH 08/11] Updated {Create} EXO Integration Tests --- .../Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 index 0fae2ce220..aacb751570 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -91,7 +91,7 @@ AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True - SentToMemberOf = @("executives@c$Domain") + SentToMemberOf = @("executives@$Domain") Priority = 1 Ensure = "Present" Credential = $Credscredential From 019185e75c54c8dc5a2d66f4d5c6e5399d5ef749 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 23 Jan 2024 09:57:15 -0500 Subject: [PATCH 09/11] Fixes Integration Tests for EXO --- .../Examples/Resources/EXOAntiPhishRule/1-Create.ps1 | 1 - .../Examples/Resources/EXOAntiPhishRule/2-Update.ps1 | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 index 317e746288..e2f6aeeba4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 @@ -27,7 +27,6 @@ Configuration Example RecipientDomainIs = $null Enabled = $True SentToMemberOf = @("executives@$Domain") - Priority = 1 Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 index b9ecd4cb39..210bb04776 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 @@ -22,12 +22,11 @@ Configuration Example ExceptIfSentTo = $null SentTo = $null ExceptIfRecipientDomainIs = $null - Comments = $null + Comments = "This is an updated comment." # Updated Property AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True SentToMemberOf = @("executives@$Domain") - Priority = 2 # Updated Property Ensure = "Present" Credential = $Credscredential } From feba0fe1153d21531b39dcf243aa2cb36ac5c4c9 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 14:58:22 +0000 Subject: [PATCH 10/11] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/exchange/EXOAntiPhishRule.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/docs/resources/exchange/EXOAntiPhishRule.md b/docs/docs/resources/exchange/EXOAntiPhishRule.md index da1567c931..f58f4814ba 100644 --- a/docs/docs/resources/exchange/EXOAntiPhishRule.md +++ b/docs/docs/resources/exchange/EXOAntiPhishRule.md @@ -75,7 +75,6 @@ Configuration Example RecipientDomainIs = $null Enabled = $True SentToMemberOf = @("executives@$Domain") - Priority = 1 Ensure = "Present" Credential = $Credscredential } @@ -108,12 +107,11 @@ Configuration Example ExceptIfSentTo = $null SentTo = $null ExceptIfRecipientDomainIs = $null - Comments = $null + Comments = "This is an updated comment." # Updated Property AntiPhishPolicy = "Our Rule" RecipientDomainIs = $null Enabled = $True SentToMemberOf = @("executives@$Domain") - Priority = 2 # Updated Property Ensure = "Present" Credential = $Credscredential } From dce9ea38bf2c74e7060e1bb2f2794c5ba8d847c9 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 15:02:07 +0000 Subject: [PATCH 11/11] Updated {Create} EXO Integration Tests --- .../Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 index aacb751570..706d11911a 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -92,7 +92,6 @@ RecipientDomainIs = $null Enabled = $True SentToMemberOf = @("executives@$Domain") - Priority = 1 Ensure = "Present" Credential = $Credscredential }