From 1cb6246e2996d0be0b64b379baa7acd60f4ffe08 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 18 Jan 2024 09:12:23 -0500 Subject: [PATCH 001/122] Integration --- .../Resources/AADConditionalAccessPolicy/1-Create.ps1 | 2 +- .../Resources/AADConditionalAccessPolicy/2-Update.ps1 | 2 +- .../Resources/AADConditionalAccessPolicy/3-Remove.ps1 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 index 644bff924b..ca2401325b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 @@ -15,7 +15,7 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 index 6693440a4a..34aa31b1ee 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 @@ -15,7 +15,7 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 index 667028b7bb..b1e7893a92 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/3-Remove.ps1 @@ -15,9 +15,9 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - DisplayName = 'Allin-example' + DisplayName = 'Example CAP' Ensure = 'Absent' Credential = $Credscredential } From 97e3b5d18dcd36be422059617cb16b39aae04961 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 14:13:58 +0000 Subject: [PATCH 002/122] Updated Resources and Cmdlet documentation pages --- .../docs/resources/azure-ad/AADConditionalAccessPolicy.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md b/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md index c3283880ec..5a53d775cb 100644 --- a/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md +++ b/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md @@ -106,7 +106,7 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); @@ -150,7 +150,7 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); @@ -194,9 +194,9 @@ Configuration Example node localhost { - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - DisplayName = 'Allin-example' + DisplayName = 'Example CAP' Ensure = 'Absent' Credential = $Credscredential } From 17063879cb773d17673302fed84352bed0b9c1eb Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 14:16:29 +0000 Subject: [PATCH 003/122] Updated {Create} AAD Integration Tests --- .../Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 index 1d417c6905..4d89b35d07 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 @@ -311,7 +311,7 @@ Ensure = "Present"; Credential = $Credscredential; } - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); From 973f1354efa5ddb9e8a86f7abe60a4bd9479e906 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 18 Jan 2024 10:03:24 -0500 Subject: [PATCH 004/122] Fixes Integration --- .../Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 | 3 --- .../Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 | 3 --- 2 files changed, 6 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 index ca2401325b..cdd98d0524 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/1-Create.ps1 @@ -17,10 +17,8 @@ Configuration Example { AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -30,7 +28,6 @@ Configuration Example GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 index 34aa31b1ee..b484a00998 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADConditionalAccessPolicy/2-Update.ps1 @@ -17,10 +17,8 @@ Configuration Example { AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -30,7 +28,6 @@ Configuration Example GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; From 7fe12c2ddf2ceb4be6decc67e0068dc7c0a6a372 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 15:05:10 +0000 Subject: [PATCH 005/122] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md b/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md index 5a53d775cb..bbeec98b03 100644 --- a/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md +++ b/docs/docs/resources/azure-ad/AADConditionalAccessPolicy.md @@ -108,10 +108,8 @@ Configuration Example { AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -121,7 +119,6 @@ Configuration Example GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; @@ -152,10 +149,8 @@ Configuration Example { AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -165,7 +160,6 @@ Configuration Example GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; From 496b81fd1d11bc0e5086ad9a8d4f8746cdbd5c1b Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 15:07:15 +0000 Subject: [PATCH 006/122] Updated {Create} AAD Integration Tests --- .../Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 index 4d89b35d07..682e23a953 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 @@ -313,10 +313,8 @@ } AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -326,7 +324,6 @@ GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; From aa499d1d55ffafd31c6e33b637fbd941544b9261 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 15:10:05 +0000 Subject: [PATCH 007/122] Updated {Update} AAD Integration Tests --- .../Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 index ef2eeadf00..335cbbd035 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 @@ -350,12 +350,10 @@ Ensure = 'Present' Credential = $Credscredential } - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - ApplicationEnforcedRestrictionsIsEnabled = $False; BuiltInControls = @("mfa"); ClientAppTypes = @("all"); - CloudAppSecurityIsEnabled = $False; Credential = $Credscredential; DeviceFilterMode = "exclude"; DeviceFilterRule = "device.trustType -eq `"AzureAD`" -or device.trustType -eq `"ServerAD`" -or device.trustType -eq `"Workplace`""; @@ -365,7 +363,6 @@ GrantControlOperator = "OR"; IncludeApplications = @("All"); IncludeRoles = @("Attack Payload Author"); - PersistentBrowserIsEnabled = $False; SignInFrequencyInterval = "timeBased"; SignInFrequencyIsEnabled = $True; SignInFrequencyType = "hours"; From f0f239669282a048a55bbeeaefdd31555f09bd17 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 15:13:24 +0000 Subject: [PATCH 008/122] Updated {Update} AAD Integration Tests --- .../M365DSCIntegration.AAD.Remove.Tests.ps1 | 48 +------------------ 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 index 6f5166aed9..38b958d5db 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 @@ -102,9 +102,9 @@ Ensure = "Absent"; Credential = $Credscredential; } - AADConditionalAccessPolicy 'Allin-example' + AADConditionalAccessPolicy 'ConditionalAccessPolicy' { - DisplayName = 'Allin-example' + DisplayName = 'Example CAP' Ensure = 'Absent' Credential = $Credscredential } @@ -220,50 +220,6 @@ } }; } - AADRoleSetting '28b253d8-cde5-471f-a331-fe7320023cdd' - { - ActivateApprover = @(); - ActivationMaxDuration = "PT8H"; - ActivationReqJustification = $False; # Updated Property - ActivationReqMFA = $False; - ActivationReqTicket = $False; - ActiveAlertNotificationAdditionalRecipient = @(); - ActiveAlertNotificationDefaultRecipient = $True; - ActiveAlertNotificationOnlyCritical = $False; - ActiveApproveNotificationAdditionalRecipient = @(); - ActiveApproveNotificationDefaultRecipient = $True; - ActiveApproveNotificationOnlyCritical = $False; - ActiveAssigneeNotificationAdditionalRecipient = @(); - ActiveAssigneeNotificationDefaultRecipient = $True; - ActiveAssigneeNotificationOnlyCritical = $False; - ApprovaltoActivate = $False; - AssignmentReqJustification = $True; - AssignmentReqMFA = $False; - Displayname = "Application Administrator"; - ElegibilityAssignmentReqJustification = $False; - ElegibilityAssignmentReqMFA = $False; - EligibleAlertNotificationAdditionalRecipient = @(); - EligibleAlertNotificationDefaultRecipient = $True; - EligibleAlertNotificationOnlyCritical = $False; - EligibleApproveNotificationAdditionalRecipient = @(); - EligibleApproveNotificationDefaultRecipient = $True; - EligibleApproveNotificationOnlyCritical = $False; - EligibleAssigneeNotificationAdditionalRecipient = @(); - EligibleAssigneeNotificationDefaultRecipient = $True; - EligibleAssigneeNotificationOnlyCritical = $False; - EligibleAssignmentAlertNotificationAdditionalRecipient = @(); - EligibleAssignmentAlertNotificationDefaultRecipient = $True; - EligibleAssignmentAlertNotificationOnlyCritical = $False; - EligibleAssignmentAssigneeNotificationAdditionalRecipient = @(); - EligibleAssignmentAssigneeNotificationDefaultRecipient = $True; - EligibleAssignmentAssigneeNotificationOnlyCritical = $False; - ExpireActiveAssignment = "P180D"; - ExpireEligibleAssignment = "P365D"; - PermanentActiveAssignmentisExpirationRequired = $False; - PermanentEligibleAssignmentisExpirationRequired = $False; - Credential = $Credscredential - Ensure = 'Absent' - } AADSecurityDefaults 'Defaults' { Credential = $Credscredential; From fc8b7b0b02d34ee96e145db54de5c86304ab99d0 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 18 Jan 2024 11:07:38 -0500 Subject: [PATCH 009/122] Fixes for Integration Tests --- CHANGELOG.md | 7 +++++ ...thenticationMethodPolicyAuthenticator.psm1 | 2 +- ...FT_AADAuthenticationMethodPolicyEmail.psm1 | 2 +- ...FT_AADAuthenticationMethodPolicyFido2.psm1 | 2 +- ...MSFT_AADAuthenticationMethodPolicySms.psm1 | 2 +- ...AADAuthenticationMethodPolicySoftware.psm1 | 2 +- ...ADAuthenticationMethodPolicyTemporary.psm1 | 2 +- ...FT_AADAuthenticationMethodPolicyVoice.psm1 | 2 +- ...SFT_AADAuthenticationMethodPolicyX509.psm1 | 2 +- .../MSFT_AADCrossTenantAccessPolicy.psm1 | 6 ++--- ...MSFT_AADCrossTenantAccessPolicy.schema.mof | 2 +- ...enantAccessPolicyConfigurationDefault.psm1 | 6 ++--- ...ccessPolicyConfigurationDefault.schema.mof | 2 +- ...AADEntitlementManagementAccessPackage.psm1 | 8 +++--- ...tlementManagementAccessPackageCatalog.psm1 | 8 +++--- .../AADCrossTenantAccessPolicy/3-Remove.ps1 | 26 ------------------- .../3-Remove.ps1 | 24 ----------------- .../3-Remove.ps1 | 2 +- 18 files changed, 32 insertions(+), 75 deletions(-) delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicy/3-Remove.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationDefault/3-Remove.ps1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 97233cfeee..b42801633f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change log for Microsoft365DSC +# UNRELEASED + +* AADCrossTenantAccessPolicy + * Removed the ability to specify a value of Absent for the Ensure property. +* AADCrossTenantAccessPolicyCOnfigurationDefault + * Removed the ability to specify a value of Absent for the Ensure property. + # 1.24.117.1 * AADAdministrativeUnit diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 index bcc87c21a1..da53cb895c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 @@ -86,7 +86,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Authenticator with id {$id}" return $nullResult diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 index 1cfbd3473a..04e3495fa5 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 @@ -84,7 +84,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Email with id {$id}" return $nullResult diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 index da26ea6b2c..53b66f918f 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 @@ -91,7 +91,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Fido2 with id {$id}" return $nullResult diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 index 11ac135f1a..67715a2229 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 @@ -79,7 +79,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Sms with id {$id}" return $nullResult diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 index 3bcab2dcf5..fcc2d95e12 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 @@ -79,7 +79,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Software with id {$id}" return $nullResult diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 index 982b5e380c..483c3e9340 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 @@ -99,7 +99,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Temporary" return $nullResult diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 index f620264991..89c5fbe047 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 @@ -83,7 +83,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy Voice with id {$id}" return $nullResult diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 index 229cfccfb5..d9997ce534 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 @@ -84,7 +84,7 @@ function Get-TargetResource $getValue = Get-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -AuthenticationMethodConfigurationId $Id -ErrorAction SilentlyContinue #endregion - if ($null -eq $getValue) + if ($null -eq $getValue -or $getValue.State -eq 'disabled') { Write-Verbose -Message "Could not find an Azure AD Authentication Method Policy X509 with id {$id}" return $nullResult diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.psm1 index c7732ebb8d..9339b59158 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.psm1 @@ -20,7 +20,7 @@ function Get-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] @@ -124,7 +124,7 @@ function Set-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] @@ -212,7 +212,7 @@ function Test-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.schema.mof index 2737f04b76..48d39c9463 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicy/MSFT_AADCrossTenantAccessPolicy.schema.mof @@ -4,7 +4,7 @@ class MSFT_AADCrossTenantAccessPolicy : OMI_BaseResource [Key, Description("Only valid value is 'Yes'."), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; [Write, Description("The name of the policy.")] String DisplayName; [Write, Description("Used to specify which Microsoft clouds an organization would like to collaborate with. By default, this value is empty."), ValueMap{"microsoftonline.com","microsoftonline.us", "partner.microsoftonline.cn"}, Values{"microsoftonline.com","microsoftonline.us", "partner.microsoftonline.cn"}] String AllowedCloudEndpoints[]; - [Write, Description("Specify if the policy should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; + [Write, Description("Specify if the policy should exist or not."), ValueMap{"Present"}, Values{"Present"}] String Ensure; [Write, Description("Credentials of the Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; [Write, Description("Id of the Azure Active Directory tenant used for authentication.")] String TenantId; diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.psm1 index 839540107b..5300c7096b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.psm1 @@ -31,7 +31,7 @@ function Get-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] @@ -170,7 +170,7 @@ function Set-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] @@ -291,7 +291,7 @@ function Test-TargetResource [Parameter()] [System.String] - [ValidateSet('Absent', 'Present')] + [ValidateSet('Present')] $Ensure = 'Present', [Parameter()] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.schema.mof index 1332c4dabd..171f341402 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADCrossTenantAccessPolicyConfigurationDefault/MSFT_AADCrossTenantAccessPolicyConfigurationDefault.schema.mof @@ -36,7 +36,7 @@ class MSFT_AADCrossTenantAccessPolicyConfigurationDefault : OMI_BaseResource [Write, Description("Defines your partner-specific configuration for users from other organizations accessing your resources via Azure AD B2B direct connect."), EmbeddedInstance("MSFT_AADCrossTenantAccessPolicyB2BSetting")] String B2BDirectConnectInbound; [Write, Description("Defines your partner-specific configuration for users in your organization going outbound to access resources in another organization via Azure AD B2B direct connect."), EmbeddedInstance("MSFT_AADCrossTenantAccessPolicyB2BSetting")] String B2BDirectConnectOutbound; [Write, Description("Determines the partner-specific configuration for trusting other Conditional Access claims from external Azure AD organizations."), EmbeddedInstance("MSFT_AADCrossTenantAccessPolicyInboundTrust")] String InboundTrust; - [Write, Description("Specify if the instance should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; + [Write, Description("Specify if the instance should exist or not."), ValueMap{"Present"}, Values{"Present"}] String Ensure; [Write, Description("Credentials of the Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; [Write, Description("Id of the Azure Active Directory tenant used for authentication.")] String TenantId; diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 index 31088bcbd6..e2aafcbded 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 @@ -111,7 +111,7 @@ function Get-TargetResource -ErrorAction SilentlyContinue } - if ($null -eq $getValue) + if ($null -eq $getValue -and -not [System.String]::IsNullOrEmpty($id)) { Write-Verbose -Message "Nothing with id {$id} was found" @@ -783,10 +783,10 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters $ValuesToCheck = ([Hashtable]$PSBoundParameters).clone() - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -eq 'Absent' -and $Ensure -eq 'Absent') { - Write-Verbose -Message "Test-TargetResource returned $false" - return $false + Write-Verbose -Message "Test-TargetResource returned $true" + return $true } $testResult = $true diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 index 0360b370d5..9b7507631b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 @@ -93,7 +93,7 @@ function Get-TargetResource $getValue = Get-MgBetaEntitlementManagementAccessPackageCatalog -AccessPackageCatalogId $id -ErrorAction SilentlyContinue } - if ($null -eq $getValue) + if ($null -eq $getValue -and -not [System.String]::IsNullOrEmpty($Id)) { Write-Verbose -Message "Nothing with id {$id} was found" @@ -357,10 +357,10 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters $ValuesToCheck = ([Hashtable]$PSBoundParameters).clone() - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -eq 'Absent' -and $Ensure -eq 'Absent') { - Write-Verbose -Message "Test-TargetResource returned $false" - return $false + Write-Verbose -Message "Test-TargetResource returned $true" + return $true } $testResult = $true diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicy/3-Remove.ps1 deleted file mode 100644 index f8c66bb0c1..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicy/3-Remove.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADCrossTenantAccessPolicy "AADCrossTenantAccessPolicy" - { - AllowedCloudEndpoints = @("microsoftonline.us"); - Credential = $Credscredential; - DisplayName = "MyXTAPPolicy"; - Ensure = "Absent"; - IsSingleInstance = "Yes"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationDefault/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationDefault/3-Remove.ps1 deleted file mode 100644 index 9941723b9b..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADCrossTenantAccessPolicyConfigurationDefault/3-Remove.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADCrossTenantAccessPolicyConfigurationDefault "AADCrossTenantAccessPolicyConfigurationDefault" - { - Credential = $Credscredential; - Ensure = "Absent"; - IsSingleInstance = "Yes"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 index a71c4849f0..3a8a14b1b3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADEntitlementManagementAccessPackage/3-Remove.ps1 @@ -16,7 +16,7 @@ Configuration Example { AADEntitlementManagementAccessPackage 'myAccessPackage' { - DisplayName = 'General' + DisplayName = 'Integration Package' Ensure = 'Absent' Credential = $Credscredential } From 2885a290f8f0f706a18e563e6503b8a0e8e416b2 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 18 Jan 2024 11:54:01 -0500 Subject: [PATCH 010/122] Update MSFT_AADEntitlementManagementAccessPackage.psm1 --- .../MSFT_AADEntitlementManagementAccessPackage.psm1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 index e2aafcbded..a4a89be7c5 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 @@ -802,6 +802,11 @@ function Test-TargetResource { $s.remove('Id') } + + if ($target.getType().Name -like '*CimInstance*') + { + $target = Get-M365DSCDRGComplexTypeToHashtable -ComplexObject $target + } foreach ($t in [Array]$target) { $t.remove('Id') From 9dfd243e0361a76492fcf9bb484f50dd71765bf7 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 17:18:17 +0000 Subject: [PATCH 011/122] Updated Resources and Cmdlet documentation pages --- .../azure-ad/AADCrossTenantAccessPolicy.md | 31 +------------------ ...sTenantAccessPolicyConfigurationDefault.md | 29 +---------------- .../AADEntitlementManagementAccessPackage.md | 2 +- 3 files changed, 3 insertions(+), 59 deletions(-) diff --git a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md index a29350a291..7e69eb68fb 100644 --- a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md +++ b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicy.md @@ -7,7 +7,7 @@ | **IsSingleInstance** | Key | String | Only valid value is 'Yes'. | `Yes` | | **DisplayName** | Write | String | The name of the policy. | | | **AllowedCloudEndpoints** | Write | StringArray[] | Used to specify which Microsoft clouds an organization would like to collaborate with. By default, this value is empty. | `microsoftonline.com`, `microsoftonline.us`, `partner.microsoftonline.cn` | -| **Ensure** | Write | String | Specify if the policy should exist or not. | `Present`, `Absent` | +| **Ensure** | Write | String | Specify if the policy should exist or not. | `Present` | | **Credential** | Write | PSCredential | Credentials of the Admin | | | **ApplicationId** | Write | String | Id of the Azure Active Directory application to authenticate with. | | | **TenantId** | Write | String | Id of the Azure Active Directory tenant used for authentication. | | @@ -77,32 +77,3 @@ Configuration Example } ``` -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADCrossTenantAccessPolicy "AADCrossTenantAccessPolicy" - { - AllowedCloudEndpoints = @("microsoftonline.us"); - Credential = $Credscredential; - DisplayName = "MyXTAPPolicy"; - Ensure = "Absent"; - IsSingleInstance = "Yes"; - } - } -} -``` - diff --git a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md index 8f0ea3db8f..4cc692275d 100644 --- a/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md +++ b/docs/docs/resources/azure-ad/AADCrossTenantAccessPolicyConfigurationDefault.md @@ -10,7 +10,7 @@ | **B2BDirectConnectInbound** | Write | MSFT_AADCrossTenantAccessPolicyB2BSetting | Defines your partner-specific configuration for users from other organizations accessing your resources via Azure AD B2B direct connect. | | | **B2BDirectConnectOutbound** | Write | MSFT_AADCrossTenantAccessPolicyB2BSetting | Defines your partner-specific configuration for users in your organization going outbound to access resources in another organization via Azure AD B2B direct connect. | | | **InboundTrust** | Write | MSFT_AADCrossTenantAccessPolicyInboundTrust | Determines the partner-specific configuration for trusting other Conditional Access claims from external Azure AD organizations. | | -| **Ensure** | Write | String | Specify if the instance should exist or not. | `Present`, `Absent` | +| **Ensure** | Write | String | Specify if the instance should exist or not. | `Present` | | **Credential** | Write | PSCredential | Credentials of the Admin | | | **ApplicationId** | Write | String | Id of the Azure Active Directory application to authenticate with. | | | **TenantId** | Write | String | Id of the Azure Active Directory tenant used for authentication. | | @@ -200,30 +200,3 @@ Configuration Example } ``` -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADCrossTenantAccessPolicyConfigurationDefault "AADCrossTenantAccessPolicyConfigurationDefault" - { - Credential = $Credscredential; - Ensure = "Absent"; - IsSingleInstance = "Yes"; - } - } -} -``` - diff --git a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md index 37af8361ef..f3857ed52c 100644 --- a/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md +++ b/docs/docs/resources/azure-ad/AADEntitlementManagementAccessPackage.md @@ -148,7 +148,7 @@ Configuration Example { AADEntitlementManagementAccessPackage 'myAccessPackage' { - DisplayName = 'General' + DisplayName = 'Integration Package' Ensure = 'Absent' Credential = $Credscredential } From 06fda185651466031bcecc07914c52213d02e8b5 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 18 Jan 2024 13:46:50 -0500 Subject: [PATCH 012/122] Integration and Fixes --- CHANGELOG.md | 16 +++ ...thenticationMethodPolicyAuthenticator.psm1 | 100 +----------------- ...FT_AADAuthenticationMethodPolicyFido2.psm1 | 47 +------- ...MSFT_AADAuthenticationMethodPolicySms.psm1 | 47 +------- ...AADAuthenticationMethodPolicySoftware.psm1 | 47 +------- ...ADAuthenticationMethodPolicyTemporary.psm1 | 47 +------- ...FT_AADAuthenticationMethodPolicyVoice.psm1 | 47 +------- ...SFT_AADAuthenticationMethodPolicyX509.psm1 | 47 +------- .../1-Create.ps1 | 66 ------------ .../1-Create.ps1 | 43 -------- .../1-Create.ps1 | 49 --------- .../1-Create.ps1 | 38 ------- .../1-Create.ps1 | 42 -------- .../1-Create.ps1 | 43 -------- .../1-Create.ps1 | 33 ------ .../1-Create.ps1 | 59 ----------- ...icationMethodPolicyAuthenticator.Tests.ps1 | 5 +- ...DAuthenticationMethodPolicyEmail.Tests.ps1 | 5 +- ...DAuthenticationMethodPolicyFido2.Tests.ps1 | 5 +- ...AADAuthenticationMethodPolicySms.Tests.ps1 | 5 +- ...thenticationMethodPolicySoftware.Tests.ps1 | 5 +- ...henticationMethodPolicyTemporary.Tests.ps1 | 5 +- ...DAuthenticationMethodPolicyVoice.Tests.ps1 | 5 +- ...ADAuthenticationMethodPolicyX509.Tests.ps1 | 5 +- 24 files changed, 31 insertions(+), 780 deletions(-) delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/1-Create.ps1 diff --git a/CHANGELOG.md b/CHANGELOG.md index b42801633f..78bafaa588 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ # UNRELEASED +* AADAuthenticationMethodPolicyAuthenticator + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicyEmail + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicyFido2 + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicySms + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicySoftware + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicyTemporary + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicyVoice + * Remove the logic path to create a new instance in favor of the update flow. +* AADAuthenticationMethodPolicyX509 + * Remove the logic path to create a new instance in favor of the update flow. * AADCrossTenantAccessPolicy * Removed the ability to specify a value of Absent for the Ensure property. * AADCrossTenantAccessPolicyCOnfigurationDefault diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 index da53cb895c..dfd66443d9 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyAuthenticator/MSFT_AADAuthenticationMethodPolicyAuthenticator.psm1 @@ -414,103 +414,15 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Authenticator with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - # replace group Displayname with group id - if ($CreateParameters.featureSettings.companionAppAllowedState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.companionAppAllowedState.includeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.companionAppAllowedState.includeTarget.foreach('id',$groupid) - } - if ($CreateParameters.featureSettings.companionAppAllowedState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.companionAppAllowedState.excludeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.companionAppAllowedState.excludeTarget.foreach('id',$groupid) - } - if ($CreateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.foreach('id',$groupid) - } - if ($UpdateParCreateParametersameters.featureSettings.displayAppInformationRequiredState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.displayAppInformationRequiredState.excludeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.displayAppInformationRequiredState.excludeTarget.foreach('id',$groupid) - } - if ($CreateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.foreach('id',$groupid) - } - if ($CreateParameters.featureSettings.displayLocationInformationRequiredState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users'){ - $Filter = "Displayname eq '$($CreateParameters.featureSettings.displayLocationInformationRequiredState.excludeTarget.id)'" | Out-String - $groupid = (Get-MgGroup -Filter $Filter).id.ToString() - $CreateParameters.featureSettings.displayLocationInformationRequiredState.excludeTarget.foreach('id',$groupid) - } - - # DEPRECATED - if ($CreateParameters.featureSettings.ContainsKey('NumberMatchingRequiredState')) - { - Write-Verbose -Message "The NumberMatchingRequiredState feature is deprecated and will be ignored. Please remove it from your configuration." - $CreateParameters.featureSettings.Remove('NumberMatchingRequiredState') - } - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key) - { - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id', (Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key) - { - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id', (Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Authenticator with Id {$($currentInstance.Id)}" $UpdateParameters = ([Hashtable]$BoundParameters).clone() $UpdateParameters = Rename-M365DSCCimInstanceParameter -Properties $UpdateParameters - $UpdateParameters.Remove('Id') | Out-Null - Write-Verbose -Message "Flag1" # replace group Displayname with group id if ($UpdateParameters.featureSettings.companionAppAllowedState.includeTarget.id -and ` $UpdateParameters.featureSettings.companionAppAllowedState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and @@ -521,8 +433,6 @@ function Set-TargetResource $groupid = (Get-MgGroup -Filter $Filter).id.ToString() $UpdateParameters.featureSettings.companionAppAllowedState.includeTarget.foreach('id',$groupid) } - - Write-Verbose -Message "Flag2" if ($UpdateParameters.featureSettings.companionAppAllowedState.excludeTarget.id -and ` $UpdateParameters.featureSettings.companionAppAllowedState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and $UpdateParameters.featureSettings.ContainsKey('companionAppAllowedState')) @@ -532,7 +442,6 @@ function Set-TargetResource $groupid = (Get-MgGroup -Filter $Filter).id.ToString() $UpdateParameters.featureSettings.companionAppAllowedState.excludeTarget.foreach('id',$groupid) } - Write-Verbose -Message "Flag3" if ($UpdateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.id -and ` $UpdateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and $UpdateParameters.featureSettings.ContainsKey('displayAppInformationRequiredState')) @@ -542,7 +451,6 @@ function Set-TargetResource $groupid = (Get-MgGroup -Filter $Filter).id.ToString() $UpdateParameters.featureSettings.displayAppInformationRequiredState.includeTarget.foreach('id',$groupid) } - Write-Verbose -Message "Flag4" if ($UpdateParameters.featureSettings.displayAppInformationRequiredState.excludeTarget.id -and ` $UpdateParameters.featureSettings.displayAppInformationRequiredState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and $UpdateParameters.featureSettings.ContainsKey('displayAppInformationRequiredState')) @@ -552,7 +460,6 @@ function Set-TargetResource $groupid = (Get-MgGroup -Filter $Filter).id.ToString() $UpdateParameters.featureSettings.displayAppInformationRequiredState.excludeTarget.foreach('id',$groupid) } - Write-Verbose -Message "Flag5" if ($UpdateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.id -and ` $UpdateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and $UpdateParameters.featureSettings.ContainsKey('displayLocationInformationRequiredState')) @@ -562,7 +469,6 @@ function Set-TargetResource $groupid = (Get-MgGroup -Filter $Filter).id.ToString() $UpdateParameters.featureSettings.displayLocationInformationRequiredState.includeTarget.foreach('id',$groupid) } - Write-Verbose -Message "Flag6" if ($UpdateParameters.featureSettings.displayLocationInformationRequiredState.excludeTarget.id -and ` $UpdateParameters.featureSettings.displayLocationInformationRequiredState.excludeTarget.id -notmatch '00000000-0000-0000-0000-000000000000|all_users' -and $UpdateParameters.featureSettings.ContainsKey('displayLocationInformationRequiredState')) @@ -574,22 +480,18 @@ function Set-TargetResource } # DEPRECATED - Write-Verbose -Message "Flag7" if ($UpdateParameters.featureSettings.ContainsKey('NumberMatchingRequiredState')) { Write-Verbose -Message "The NumberMatchingRequiredState feature is deprecated and will be ignored. Please remove it from your configuration." $UpdateParameters.featureSettings.Remove('NumberMatchingRequiredState') } - Write-Verbose -Message "Flag8" $keys = (([Hashtable]$UpdateParameters).clone()).Keys foreach ($key in $keys) { if ($null -ne $UpdateParameters.$key -and $UpdateParameters.$key.getType().Name -like '*cimInstance*') { - Write-Verbose -Message "Flag9a" $UpdateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $UpdateParameters.$key - Write-Verbose -Message "Flag9b" } if ($key -eq 'IncludeTargets' -or $key -eq 'ExcludeTargets') { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 index 53b66f918f..f185f8d8cd 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyFido2/MSFT_AADAuthenticationMethodPolicyFido2.psm1 @@ -278,52 +278,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Fido2 with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.fido2AuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Fido2 with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 index 67715a2229..6468ccd7ba 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySms/MSFT_AADAuthenticationMethodPolicySms.psm1 @@ -238,52 +238,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Sms with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.smsAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Sms with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 index fcc2d95e12..b455da368a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicySoftware/MSFT_AADAuthenticationMethodPolicySoftware.psm1 @@ -238,52 +238,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Software with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.softwareOathAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Software with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 index 483c3e9340..fd509d30a2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyTemporary/MSFT_AADAuthenticationMethodPolicyTemporary.psm1 @@ -286,52 +286,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Temporary with DisplayName {$DisplayName}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.temporaryAccessPassAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Temporary with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 index 89c5fbe047..63a37ba8b8 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyVoice/MSFT_AADAuthenticationMethodPolicyVoice.psm1 @@ -247,52 +247,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Voice with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.voiceAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Voice with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 index d9997ce534..b6cb728bb6 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyX509/MSFT_AADAuthenticationMethodPolicyX509.psm1 @@ -310,52 +310,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy X509 with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.x509CertificateAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy X509 with Id {$($currentInstance.Id)}" diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/1-Create.ps1 deleted file mode 100644 index 4154df76fb..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyAuthenticator/1-Create.ps1 +++ /dev/null @@ -1,66 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyAuthenticator "AADAuthenticationMethodPolicyAuthenticator-MicrosoftAuthenticator" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorExcludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - FeatureSettings = MSFT_MicrosoftGraphmicrosoftAuthenticatorFeatureSettings{ - DisplayLocationInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - CompanionAppAllowedState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - DisplayAppInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - }; - Id = "MicrosoftAuthenticator"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Northwind Traders' - TargetType = 'group' - } - ); - IsSoftwareOathEnabled = $False; - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/1-Create.ps1 deleted file mode 100644 index 4fd4b2ef08..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/1-Create.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyEmail "AADAuthenticationMethodPolicyEmail-Email" - { - AllowExternalIdToUseEmailOtp = "enabled"; - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "Email"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/1-Create.ps1 deleted file mode 100644 index 5f5610df96..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/1-Create.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyFido2 "AADAuthenticationMethodPolicyFido2-Fido2" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - Id = "Fido2"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2IncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsAttestationEnforced = $False; - IsSelfServiceRegistrationAllowed = $True; - KeyRestrictions = MSFT_MicrosoftGraphfido2KeyRestrictions{ - IsEnforced = $False - EnforcementType = 'block' - AaGuids = @() - }; - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/1-Create.ps1 deleted file mode 100644 index 22f4f8c8a5..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/1-Create.ps1 +++ /dev/null @@ -1,38 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicySms "AADAuthenticationMethodPolicySms-Sms" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsExcludeTarget{ - Id = 'All Employees' - TargetType = 'group' - } - ); - Id = "Sms"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/1-Create.ps1 deleted file mode 100644 index 0efd4c1697..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/1-Create.ps1 +++ /dev/null @@ -1,42 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicySoftware "AADAuthenticationMethodPolicySoftware-SoftwareOath" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "SoftwareOath"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/1-Create.ps1 deleted file mode 100644 index 383f603274..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyTemporary/1-Create.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyTemporary "AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass" - { - Credential = $Credscredential; - DefaultLength = 8; - DefaultLifetimeInMinutes = 60; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryExcludeTarget{ - Id = 'All Company' - TargetType = 'group' - } - ); - Id = "TemporaryAccessPass"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryIncludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - IsUsableOnce = $False; - MaximumLifetimeInMinutes = 480; - MinimumLifetimeInMinutes = 60; - State = "enabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/1-Create.ps1 deleted file mode 100644 index 4a86e634df..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/1-Create.ps1 +++ /dev/null @@ -1,33 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyVoice "AADAuthenticationMethodPolicyVoice-Voice" - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $False; - State = "disabled"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/1-Create.ps1 deleted file mode 100644 index 9e05e83498..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyX509/1-Create.ps1 +++ /dev/null @@ -1,59 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyX509 "AADAuthenticationMethodPolicyX509-X509Certificate" - { - AuthenticationModeConfiguration = MSFT_MicrosoftGraphx509CertificateAuthenticationModeConfiguration{ - X509CertificateAuthenticationDefaultMode = 'x509CertificateSingleFactor' - Rules = @(@()) - }; - CertificateUserBindings = @( - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 1 - UserProperty = 'userPrincipalName' - X509CertificateField = 'PrincipalName' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 2 - UserProperty = 'userPrincipalName' - X509CertificateField = 'RFC822Name' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 3 - UserProperty = 'certificateUserIds' - X509CertificateField = 'SubjectKeyIdentifier' - } - ); - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509ExcludeTarget{ - Id = 'Sales Team' - TargetType = 'group' - } - ); - Id = "X509Certificate"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509IncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyAuthenticator.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyAuthenticator.Tests.ps1 index 571c082318..b687b228f7 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyAuthenticator.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyAuthenticator.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -121,7 +118,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyEmail.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyEmail.Tests.ps1 index 5a9690a10b..03554e3dfb 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyEmail.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyEmail.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -86,7 +83,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyFido2.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyFido2.Tests.ps1 index cdb5d09402..5a44697019 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyFido2.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyFido2.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -92,7 +89,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySms.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySms.Tests.ps1 index dbc3e2f1b5..434432df8b 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySms.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySms.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -85,7 +82,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySoftware.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySoftware.Tests.ps1 index 5d0df700fd..3cd28fd14d 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySoftware.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicySoftware.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -85,7 +82,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyTemporary.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyTemporary.Tests.ps1 index 4f64eca856..bf484b051b 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyTemporary.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyTemporary.Tests.ps1 @@ -29,9 +29,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -89,7 +86,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyVoice.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyVoice.Tests.ps1 index 7ecb78c1b9..0b4497e9ed 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyVoice.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyVoice.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -86,7 +83,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyX509.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyX509.Tests.ps1 index 76fd4dafe5..06f7f1210f 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyX509.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADAuthenticationMethodPolicyX509.Tests.ps1 @@ -30,9 +30,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } - Mock -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { - } - Mock -CommandName Remove-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -MockWith { } @@ -95,7 +92,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should Create the group from the Set method' { Set-TargetResource @testParams - Should -Invoke -CommandName New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 + Should -Invoke -CommandName Update-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -Exactly 1 } } From 0eeec01faa7a586b45caf9cfec71e6a534637a62 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 18 Jan 2024 14:01:51 -0500 Subject: [PATCH 013/122] Update MSFT_AADAuthenticationMethodPolicyEmail.psm1 --- ...FT_AADAuthenticationMethodPolicyEmail.psm1 | 47 +------------------ 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 index 04e3495fa5..d003bcb1b2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADAuthenticationMethodPolicyEmail/MSFT_AADAuthenticationMethodPolicyEmail.psm1 @@ -257,52 +257,7 @@ function Set-TargetResource $BoundParameters = Remove-M365DSCAuthenticationParameter -BoundParameters $PSBoundParameters - if ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Absent') - { - Write-Verbose -Message "Creating an Azure AD Authentication Method Policy Email with id {$id}" - - $CreateParameters = ([Hashtable]$BoundParameters).clone() - $CreateParameters = Rename-M365DSCCimInstanceParameter -Properties $CreateParameters - $CreateParameters.Remove('Id') | Out-Null - - $keys = (([Hashtable]$CreateParameters).clone()).Keys - foreach ($key in $keys) - { - if ($null -ne $CreateParameters.$key -and $CreateParameters.$key.getType().Name -like '*cimInstance*') - { - $CreateParameters.$key = Convert-M365DSCDRGComplexTypeToHashtable -ComplexObject $CreateParameters.$key - } - if ($key -eq 'IncludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - if ($key -eq 'ExcludeTargets') - { - $i = 0 - foreach ($entry in $CreateParameters.$key){ - if ($entry.id -notmatch '^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|all_users') - { - $Filter = "Displayname eq '$($entry.id)'" | Out-String - $CreateParameters.$key[$i].foreach('id',(Get-MgGroup -Filter $Filter).id.ToString()) - } - $i++ - } - } - } - #region resource generator code - $CreateParameters.Add('@odata.type', '#microsoft.graph.emailAuthenticationMethodConfiguration') - $policy = New-MgBetaPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration -BodyParameter $CreateParameters - #endregion - } - elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') + if ($Ensure -eq 'Present') { Write-Verbose -Message "Updating the Azure AD Authentication Method Policy Email with Id {$($currentInstance.Id)}" From fbf982dc3049700e0e71f4b70e528ca27be52758 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 18 Jan 2024 14:06:10 -0500 Subject: [PATCH 014/122] Fixed Verbose in Unit Tests --- .../Microsoft365DSC.IntuneAccountProtectionPolicy.Tests.ps1 | 2 +- .../Microsoft365DSC.M365DSCRuleEvaluation.Tests.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneAccountProtectionPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneAccountProtectionPolicy.Tests.ps1 index b1fbf8669a..19e09bc2af 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneAccountProtectionPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.IntuneAccountProtectionPolicy.Tests.ps1 @@ -267,7 +267,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } It 'Should return Present from the Get method' { - (Get-TargetResource @testParams -Verbose).Ensure | Should -Be 'Present' + (Get-TargetResource @testParams).Ensure | Should -Be 'Present' } It 'Should return true from the Test method' { diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.M365DSCRuleEvaluation.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.M365DSCRuleEvaluation.Tests.ps1 index b92477995b..e8699a1723 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.M365DSCRuleEvaluation.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.M365DSCRuleEvaluation.Tests.ps1 @@ -15,7 +15,7 @@ Import-Module -Name (Join-Path -Path $M365DSCTestFolder ` -Resolve) $Global:DscHelper = New-M365DscUnitTestHelper -StubModule $CmdletModule ` - -DscResource 'M365DScRuleEvaluation' -GenericStubModule $GenericStubPath + -DscResource 'M365DSCRuleEvaluation' -GenericStubModule $GenericStubPath Describe -Name $Global:DscHelper.DescribeHeader -Fixture { InModuleScope -ModuleName $Global:DscHelper.ModuleName -ScriptBlock { Invoke-Command -ScriptBlock $Global:DscHelper.InitializeScript -NoNewScope @@ -32,7 +32,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } Mock -CommandName MSFT_AADConditionalAccessPolicy\Export-TargetResource -MockWith { - return "AADConditionalAccessPolicy 'FakeItem1'{`r`n State = 'Enabled'`r`n}`r`nAADConditionalAccessPolicy 'FakeItem2'{`r`n State = 'Disabled'`r`n}" + return "AADConditionalAccessPolicy 'FakeItem1'{`r`n DisplayName='test';State = 'Enabled'`r`n}`r`nAADConditionalAccessPolicy 'FakeItem2'{`r`n DisplayName='test';State = 'Disabled'`r`n}" } Mock -CommandName New-M365DSCConnection -MockWith { From 247661efc8699b88068295c39c171c647bd06af5 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 19:18:39 +0000 Subject: [PATCH 015/122] Updated Resources and Cmdlet documentation pages --- ...AuthenticationMethodPolicyAuthenticator.md | 71 +------------------ .../AADAuthenticationMethodPolicyEmail.md | 48 +------------ .../AADAuthenticationMethodPolicyFido2.md | 54 +------------- .../AADAuthenticationMethodPolicySms.md | 43 +---------- .../AADAuthenticationMethodPolicySoftware.md | 47 +----------- .../AADAuthenticationMethodPolicyTemporary.md | 48 +------------ .../AADAuthenticationMethodPolicyVoice.md | 38 +--------- .../AADAuthenticationMethodPolicyX509.md | 64 +---------------- 8 files changed, 8 insertions(+), 405 deletions(-) diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md index 14cbb25b2e..585d391c5a 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyAuthenticator.md @@ -104,75 +104,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyAuthenticator "AADAuthenticationMethodPolicyAuthenticator-MicrosoftAuthenticator" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorExcludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - FeatureSettings = MSFT_MicrosoftGraphmicrosoftAuthenticatorFeatureSettings{ - DisplayLocationInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - CompanionAppAllowedState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - DisplayAppInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - }; - Id = "MicrosoftAuthenticator"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Northwind Traders' - TargetType = 'group' - } - ); - IsSoftwareOathEnabled = $False; - State = "enabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { @@ -237,7 +168,7 @@ Configuration Example } ``` -### Example 3 +### Example 2 This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md index 2b5c62d557..e1d8aaddf1 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md @@ -73,52 +73,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyEmail "AADAuthenticationMethodPolicyEmail-Email" - { - AllowExternalIdToUseEmailOtp = "enabled"; - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "Email"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { @@ -160,7 +114,7 @@ Configuration Example } ``` -### Example 3 +### Example 2 This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md index 3f3d52b50c..2a8b8e8b80 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md @@ -85,58 +85,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyFido2 "AADAuthenticationMethodPolicyFido2-Fido2" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - Id = "Fido2"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2IncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsAttestationEnforced = $False; - IsSelfServiceRegistrationAllowed = $True; - KeyRestrictions = MSFT_MicrosoftGraphfido2KeyRestrictions{ - IsEnforced = $False - EnforcementType = 'block' - AaGuids = @() - }; - State = "enabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { @@ -184,7 +132,7 @@ Configuration Example } ``` -### Example 3 +### Example 2 This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md index 69360fefdb..f6b909ec21 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md @@ -72,47 +72,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicySms "AADAuthenticationMethodPolicySms-Sms" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsExcludeTarget{ - Id = 'All Employees' - TargetType = 'group' - } - ); - Id = "Sms"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { @@ -149,7 +108,7 @@ Configuration Example } ``` -### Example 3 +### Example 2 This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md index b74df2e7f8..e2f6f5ad80 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md @@ -72,51 +72,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicySoftware "AADAuthenticationMethodPolicySoftware-SoftwareOath" - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "SoftwareOath"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { @@ -157,7 +112,7 @@ Configuration Example } ``` -### Example 3 +### Example 2 This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md index 23c2499d7c..c5b01b925c 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyTemporary.md @@ -77,52 +77,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyTemporary "AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass" - { - Credential = $Credscredential; - DefaultLength = 8; - DefaultLifetimeInMinutes = 60; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryExcludeTarget{ - Id = 'All Company' - TargetType = 'group' - } - ); - Id = "TemporaryAccessPass"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryIncludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - IsUsableOnce = $False; - MaximumLifetimeInMinutes = 480; - MinimumLifetimeInMinutes = 60; - State = "enabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { @@ -164,7 +118,7 @@ Configuration Example } ``` -### Example 3 +### Example 2 This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md index a8ae86de8f..fccdd14fa5 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md @@ -73,42 +73,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyVoice "AADAuthenticationMethodPolicyVoice-Voice" - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $False; - State = "disabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { @@ -140,7 +104,7 @@ Configuration Example } ``` -### Example 3 +### Example 2 This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md index 501599cef5..85181df313 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyX509.md @@ -104,68 +104,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyX509 "AADAuthenticationMethodPolicyX509-X509Certificate" - { - AuthenticationModeConfiguration = MSFT_MicrosoftGraphx509CertificateAuthenticationModeConfiguration{ - X509CertificateAuthenticationDefaultMode = 'x509CertificateSingleFactor' - Rules = @(@()) - }; - CertificateUserBindings = @( - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 1 - UserProperty = 'userPrincipalName' - X509CertificateField = 'PrincipalName' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 2 - UserProperty = 'userPrincipalName' - X509CertificateField = 'RFC822Name' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 3 - UserProperty = 'certificateUserIds' - X509CertificateField = 'SubjectKeyIdentifier' - } - ); - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509ExcludeTarget{ - Id = 'Sales Team' - TargetType = 'group' - } - ); - Id = "X509Certificate"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509IncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { @@ -223,7 +161,7 @@ Configuration Example } ``` -### Example 3 +### Example 2 This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. From 3970f03e57868a5551f790e4d078c712dae596a0 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 19:20:16 +0000 Subject: [PATCH 016/122] Updated {Create} AAD Integration Tests --- .../M365DSCIntegration.AAD.Create.Tests.ps1 | 221 ------------------ 1 file changed, 221 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 index 682e23a953..e639ffe2c2 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 @@ -82,227 +82,6 @@ Id = "c3"; IsAvailable = $True; } - AADAuthenticationMethodPolicyAuthenticator 'AADAuthenticationMethodPolicyAuthenticator-MicrosoftAuthenticator' - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorExcludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - FeatureSettings = MSFT_MicrosoftGraphmicrosoftAuthenticatorFeatureSettings{ - DisplayLocationInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - CompanionAppAllowedState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - DisplayAppInformationRequiredState = MSFT_MicrosoftGraphAuthenticationMethodFeatureConfiguration{ - IncludeTarget = MSFT_AADAuthenticationMethodPolicyAuthenticatorFeatureTarget{ - Id = 'all_users' - TargetType = 'group' - } - State = 'default' - } - }; - Id = "MicrosoftAuthenticator"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyAuthenticatorIncludeTarget{ - Id = 'Northwind Traders' - TargetType = 'group' - } - ); - IsSoftwareOathEnabled = $False; - State = "enabled"; - } - AADAuthenticationMethodPolicyEmail 'AADAuthenticationMethodPolicyEmail-Email' - { - AllowExternalIdToUseEmailOtp = "enabled"; - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "Email"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyEmailIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - AADAuthenticationMethodPolicyFido2 'AADAuthenticationMethodPolicyFido2-Fido2' - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicyFido2ExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - Id = "Fido2"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyFido2IncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsAttestationEnforced = $False; - IsSelfServiceRegistrationAllowed = $True; - KeyRestrictions = MSFT_MicrosoftGraphfido2KeyRestrictions{ - IsEnforced = $False - EnforcementType = 'block' - AaGuids = @() - }; - State = "enabled"; - } - AADAuthenticationMethodPolicySms 'AADAuthenticationMethodPolicySms-Sms' - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsExcludeTarget{ - Id = 'All Employees' - TargetType = 'group' - } - ); - Id = "Sms"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySmsIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - State = "enabled"; - } - AADAuthenticationMethodPolicySoftware 'AADAuthenticationMethodPolicySoftware-SoftwareOath' - { - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - MSFT_AADAuthenticationMethodPolicySoftwareExcludeTarget{ - Id = 'Paralegals' - TargetType = 'group' - } - ); - Id = "SoftwareOath"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicySoftwareIncludeTarget{ - Id = 'Legal Team' - TargetType = 'group' - } - ); - State = "enabled"; - } - AADAuthenticationMethodPolicyTemporary 'AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass' - { - Credential = $Credscredential; - DefaultLength = 8; - DefaultLifetimeInMinutes = 60; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryExcludeTarget{ - Id = 'All Company' - TargetType = 'group' - } - ); - Id = "TemporaryAccessPass"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyTemporaryIncludeTarget{ - Id = 'Executives' - TargetType = 'group' - } - ); - IsUsableOnce = $False; - MaximumLifetimeInMinutes = 480; - MinimumLifetimeInMinutes = 60; - State = "enabled"; - } - AADAuthenticationMethodPolicyVoice 'AADAuthenticationMethodPolicyVoice-Voice' - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $False; - State = "disabled"; - } - AADAuthenticationMethodPolicyX509 'AADAuthenticationMethodPolicyX509-X509Certificate' - { - AuthenticationModeConfiguration = MSFT_MicrosoftGraphx509CertificateAuthenticationModeConfiguration{ - X509CertificateAuthenticationDefaultMode = 'x509CertificateSingleFactor' - Rules = @(@()) - }; - CertificateUserBindings = @( - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 1 - UserProperty = 'userPrincipalName' - X509CertificateField = 'PrincipalName' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 2 - UserProperty = 'userPrincipalName' - X509CertificateField = 'RFC822Name' - } - MSFT_MicrosoftGraphx509CertificateUserBinding{ - Priority = 3 - UserProperty = 'certificateUserIds' - X509CertificateField = 'SubjectKeyIdentifier' - } - ); - Credential = $Credscredential; - Ensure = "Present"; - ExcludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509ExcludeTarget{ - Id = 'Sales Team' - TargetType = 'group' - } - ); - Id = "X509Certificate"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyX509IncludeTarget{ - Id = 'Finance Team' - TargetType = 'group' - } - ); - State = "enabled"; - } AADAuthenticationStrengthPolicy 'AADAuthenticationStrengthPolicy-Example' { AllowedCombinations = @("windowsHelloForBusiness","fido2","x509CertificateMultiFactor","deviceBasedPush"); From 1ea6ecb5f2d092d3dbbad6c7d6540174c2c4b5ea Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 18 Jan 2024 14:52:54 -0500 Subject: [PATCH 017/122] Fixes --- .../MSFT_AADEntitlementManagementAccessPackage.psm1 | 7 +++++-- .../MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 | 7 +++++-- ...MSFT_AADEntitlementManagementConnectedOrganization.psm1 | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 index a4a89be7c5..d3af2977c2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackage/MSFT_AADEntitlementManagementAccessPackage.psm1 @@ -111,9 +111,12 @@ function Get-TargetResource -ErrorAction SilentlyContinue } - if ($null -eq $getValue -and -not [System.String]::IsNullOrEmpty($id)) + if ($null -eq $getValue) { - Write-Verbose -Message "Nothing with id {$id} was found" + if(-not [System.String]::IsNullOrEmpty($id)) + { + Write-Verbose -Message "Nothing with id {$id} was found" + } if (-Not [string]::IsNullOrEmpty($DisplayName)) { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 index 9b7507631b..e277b29f1b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementAccessPackageCatalog/MSFT_AADEntitlementManagementAccessPackageCatalog.psm1 @@ -93,9 +93,12 @@ function Get-TargetResource $getValue = Get-MgBetaEntitlementManagementAccessPackageCatalog -AccessPackageCatalogId $id -ErrorAction SilentlyContinue } - if ($null -eq $getValue -and -not [System.String]::IsNullOrEmpty($Id)) + if ($null -eq $getValue) { - Write-Verbose -Message "Nothing with id {$id} was found" + if (-not [System.String]::IsNullOrEmpty($Id)) + { + Write-Verbose -Message "Nothing with id {$id} was found" + } if (-Not [string]::IsNullOrEmpty($DisplayName)) { diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 index 9f7c6f4e0e..6e7b94cf31 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADEntitlementManagementConnectedOrganization/MSFT_AADEntitlementManagementConnectedOrganization.psm1 @@ -93,7 +93,10 @@ function Get-TargetResource if ($null -eq $getValue) { - Write-Verbose -Message "Entitlement Management Connected Organization with id {$id} was not found." + if (-not [System.String]::IsNullOrEmpty($id)) + { + Write-Verbose -Message "Entitlement Management Connected Organization with id {$id} was not found." + } if (-Not [string]::IsNullOrEmpty($DisplayName)) { From 369ca94d8dbd107eb97ed7fbb1522a9520f72100 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 18 Jan 2024 16:28:20 -0500 Subject: [PATCH 018/122] FIxes Integration --- .../Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 | 2 +- .../Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 | 2 +- .../Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 | 2 +- .../AADAuthenticationMethodPolicySoftware/2-Update.ps1 | 2 +- .../Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 index da4c2f15b5..889bee8111 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/2-Update.ps1 @@ -37,7 +37,7 @@ Configuration Example TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 index 64b188cf46..cce861359c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyFido2/2-Update.ps1 @@ -43,7 +43,7 @@ Configuration Example EnforcementType = 'block' AaGuids = @() }; - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 index e0f3f6c9a8..7111b8b114 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySms/2-Update.ps1 @@ -32,7 +32,7 @@ Configuration Example TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 index 9223768e7e..808ff41034 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicySoftware/2-Update.ps1 @@ -36,7 +36,7 @@ Configuration Example TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 index c895589eb3..21b814cb5b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 @@ -27,7 +27,7 @@ Configuration Example } ); IsOfficePhoneAllowed = $True; # Updated Property - State = "disabled"; + State = "enabled"; } } } From 17852365e40cd8e9c3e2d04758e314a84bbfe34e Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 18 Jan 2024 16:29:33 -0500 Subject: [PATCH 019/122] Update 2-Update.ps1 --- .../AADAuthenticationMethodPolicyVoice/2-Update.ps1 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 index 21b814cb5b..60cb690b66 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 @@ -20,14 +20,7 @@ Configuration Example Credential = $Credscredential; Ensure = "Present"; Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $True; # Updated Property - State = "enabled"; + State = "disabled"; } } } From 9b36dc40d5d868a3ddd3da37666b265e4a7f9dd0 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 21:31:08 +0000 Subject: [PATCH 020/122] Updated Resources and Cmdlet documentation pages --- .../azure-ad/AADAuthenticationMethodPolicyEmail.md | 2 +- .../azure-ad/AADAuthenticationMethodPolicyFido2.md | 2 +- .../resources/azure-ad/AADAuthenticationMethodPolicySms.md | 2 +- .../azure-ad/AADAuthenticationMethodPolicySoftware.md | 2 +- .../azure-ad/AADAuthenticationMethodPolicyVoice.md | 7 ------- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md index e1d8aaddf1..45d7db151b 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md @@ -108,7 +108,7 @@ Configuration Example TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md index 2a8b8e8b80..5cdddd32b0 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyFido2.md @@ -126,7 +126,7 @@ Configuration Example EnforcementType = 'block' AaGuids = @() }; - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md index f6b909ec21..a19bdaeda1 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySms.md @@ -102,7 +102,7 @@ Configuration Example TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md index e2f6f5ad80..b1f4fc5af0 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicySoftware.md @@ -106,7 +106,7 @@ Configuration Example TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } } } diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md index fccdd14fa5..f3b3be05a4 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md @@ -91,13 +91,6 @@ Configuration Example Credential = $Credscredential; Ensure = "Present"; Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $True; # Updated Property State = "disabled"; } } From 02597f0e41499df60509ccfa5b587947cb605b68 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 21:36:11 +0000 Subject: [PATCH 021/122] Updated {Update} AAD Integration Tests --- .../M365DSCIntegration.AAD.Update.Tests.ps1 | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 index 335cbbd035..3ef1f1d119 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 @@ -172,7 +172,7 @@ TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } AADAuthenticationMethodPolicyFido2 'AADAuthenticationMethodPolicyFido2-Fido2' { @@ -202,7 +202,7 @@ EnforcementType = 'block' AaGuids = @() }; - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } AADAuthenticationMethodPolicySms 'AADAuthenticationMethodPolicySms-Sms' { @@ -221,7 +221,7 @@ TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } AADAuthenticationMethodPolicySoftware 'AADAuthenticationMethodPolicySoftware-SoftwareOath' { @@ -244,7 +244,7 @@ TargetType = 'group' } ); - State = "disabled"; # Updated Property + State = "enabled"; # Updated Property } AADAuthenticationMethodPolicyTemporary 'AADAuthenticationMethodPolicyTemporary-TemporaryAccessPass' { @@ -275,13 +275,6 @@ Credential = $Credscredential; Ensure = "Present"; Id = "Voice"; - IncludeTargets = @( - MSFT_AADAuthenticationMethodPolicyVoiceIncludeTarget{ - Id = 'all_users' - TargetType = 'group' - } - ); - IsOfficePhoneAllowed = $True; # Updated Property State = "disabled"; } AADAuthenticationMethodPolicyX509 'AADAuthenticationMethodPolicyX509-X509Certificate' From 82e5701b0d706247ba3396077dbdd700517b1136 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 18 Jan 2024 17:14:27 -0500 Subject: [PATCH 022/122] Delete 2-Update.ps1 --- .../2-Update.ps1 | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 deleted file mode 100644 index 60cb690b66..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyVoice/2-Update.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyVoice "AADAuthenticationMethodPolicyVoice-Voice" - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - State = "disabled"; - } - } -} From f9f536d5f02344835af17d42d6e38ac98a62f45d Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 18 Jan 2024 22:15:52 +0000 Subject: [PATCH 023/122] Updated Resources and Cmdlet documentation pages --- .../AADAuthenticationMethodPolicyVoice.md | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md index f3b3be05a4..fed2b086d0 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyVoice.md @@ -73,35 +73,6 @@ To authenticate with the Microsoft Graph API, this resource required the followi This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline. -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyVoice "AADAuthenticationMethodPolicyVoice-Voice" - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - State = "disabled"; - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - ```powershell Configuration Example { From e0e4c9af4c1364b06149c2ab044fdebf5b1f9ebd Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Fri, 19 Jan 2024 13:01:47 +0000 Subject: [PATCH 024/122] Updated {Update} AAD Integration Tests --- .../M365DSCIntegration.AAD.Update.Tests.ps1 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 index 3ef1f1d119..ead0477bf2 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 @@ -270,13 +270,6 @@ MinimumLifetimeInMinutes = 60; State = "enabled"; } - AADAuthenticationMethodPolicyVoice 'AADAuthenticationMethodPolicyVoice-Voice' - { - Credential = $Credscredential; - Ensure = "Present"; - Id = "Voice"; - State = "disabled"; - } AADAuthenticationMethodPolicyX509 'AADAuthenticationMethodPolicyX509-X509Certificate' { AuthenticationModeConfiguration = MSFT_MicrosoftGraphx509CertificateAuthenticationModeConfiguration{ From 3398545749a63ad5e4a9139085b88c230548360d Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Fri, 19 Jan 2024 13:04:39 +0000 Subject: [PATCH 025/122] Updated {Update} AAD Integration Tests --- .../M365DSCIntegration.AAD.Remove.Tests.ps1 | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 index 38b958d5db..0c3294cc4d 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 @@ -108,20 +108,6 @@ Ensure = 'Absent' Credential = $Credscredential } - AADCrossTenantAccessPolicy 'AADCrossTenantAccessPolicy' - { - AllowedCloudEndpoints = @("microsoftonline.us"); - Credential = $Credscredential; - DisplayName = "MyXTAPPolicy"; - Ensure = "Absent"; - IsSingleInstance = "Yes"; - } - AADCrossTenantAccessPolicyConfigurationDefault 'AADCrossTenantAccessPolicyConfigurationDefault' - { - Credential = $Credscredential; - Ensure = "Absent"; - IsSingleInstance = "Yes"; - } AADCrossTenantAccessPolicyConfigurationPartner 'AADCrossTenantAccessPolicyConfigurationPartner' { Credential = $Credscredential; @@ -130,7 +116,7 @@ } AADEntitlementManagementAccessPackage 'myAccessPackage' { - DisplayName = 'General' + DisplayName = 'Integration Package' Ensure = 'Absent' Credential = $Credscredential } From 9cc4b62ba4c64ee7f8bf5bc8ae9c56baba32f6df Mon Sep 17 00:00:00 2001 From: Michael Barmettler <99532854+mibarm@users.noreply.github.com> Date: Fri, 19 Jan 2024 14:09:13 +0100 Subject: [PATCH 026/122] wip --- .../MSFT_AADConditionalAccessPolicy.psm1 | 77 ++++++++++++++++++- 1 file changed, 74 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 index d5fd93d23c..7dbfcd0e43 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 @@ -958,10 +958,18 @@ function Set-TargetResource { $conditions.Applications.Add('IncludeApplications', $IncludeApplications) } + else + { + $conditions.Applications.Add('IncludeApplications', $currentPolicy.IncludeApplications) + } if ($currentParameters.ContainsKey("ExcludeApplications")) { $conditions.Applications.Add('ExcludeApplications', $ExcludeApplications) } + else + { + $conditions.Applications.Add('ExcludeApplications', $currentPolicy.ExcludeApplications) + } if ($ApplicationsFilter -and $ApplicationsFilterMode) { $appFilterValue = @{ @@ -970,11 +978,19 @@ function Set-TargetResource } $conditions.Applications.Add("ApplicationFilter", $appFilterValue) } + else + { + $conditions.Applications.Add("ApplicationFilter", $currentPolicy.ApplicationsFilter) + } if ($IncludeUserActions) { $conditions.Applications.Add('IncludeUserActions', $IncludeUserActions) } + else + { + $conditions.Applications.Add('IncludeUserActions', $currentPolicy.IncludeUserActions) + } if ($AuthenticationContexts) { # Retrieve the class reference based on display name. @@ -993,6 +1009,9 @@ function Set-TargetResource #create and provision User Condition object Write-Verbose -Message 'Set-Targetresource: process includeusers' + if (!$currentParameters.ContainsKey('IncludeUsers') -and $null -ne $currentPolicy.IncludeUsers) { + $IncludeUsers = $currentPolicy.IncludeUsers + } $conditions.Users.Add('IncludeUsers', @()) foreach ($includeuser in $IncludeUsers) { @@ -1033,8 +1052,11 @@ function Set-TargetResource } } } - Write-Verbose -Message 'Set-Targetresource: process excludeusers' + Write-Verbose -Message 'Set-Targetresource: process excludeusers' + if (!$currentParameters.ContainsKey('ExcludeUsers') -and $null -ne $currentPolicy.ExcludeUsers) { + $ExcludeUsers = $currentPolicy.ExcludeUsers + } $conditions.Users.Add('ExcludeUsers', @()) foreach ($excludeuser in $ExcludeUsers) { @@ -1076,6 +1098,9 @@ function Set-TargetResource } } Write-Verbose -Message 'Set-Targetresource: process includegroups' + if (!$currentParameters.ContainsKey('IncludeGroups') -and $null -ne $currentPolicy.IncludeGroups) { + $IncludeGroups = $currentPolicy.IncludeGroups + } $conditions.Users.Add('IncludeGroups', @()) foreach ($includegroup in $IncludeGroups) { @@ -1119,8 +1144,11 @@ function Set-TargetResource } } - $conditions.Users.Add('ExcludeGroups', @()) Write-Verbose -Message 'Set-Targetresource: process excludegroups' + if (!$currentParameters.ContainsKey('ExcludeGroups') -and $null -ne $currentPolicy.ExcludeGroups) { + $ExcludeGroups = $currentPolicy.ExcludeGroups + } + $conditions.Users.Add('ExcludeGroups', @()) foreach ($ExcludeGroup in $ExcludeGroups) { #translate user Group names to GUID @@ -1162,7 +1190,11 @@ function Set-TargetResource } } } + Write-Verbose -Message 'Set-Targetresource: process includeroles' + if (!$currentParameters.ContainsKey('IncludeRoles') -and $null -ne $currentPolicy.IncludeRoles) { + $IncludeRoles = $currentPolicy.IncludeRoles + } $conditions.Users.Add('IncludeRoles', @()) if ($IncludeRoles) { @@ -1191,7 +1223,11 @@ function Set-TargetResource } } } + Write-Verbose -Message 'Set-Targetresource: process excluderoles' + if (!$currentParameters.ContainsKey('ExcludeRoles') -and $null -ne $currentPolicy.ExcludeRoles) { + $ExcludeRoles = $currentPolicy.ExcludeRoles + } $conditions.Users.Add('ExcludeRoles', @()) if ($ExcludeRoles) { @@ -1221,7 +1257,10 @@ function Set-TargetResource } } } - Write-Verbose -Message 'Set-Targetresource: process includeGuestsOrExternalUsers' + Write-Verbose -Message 'Set-Targetresource: process includeGuestOrExternalUser' + If (!$currentParameters.ContainsKey('IncludeGuestOrExternalUserTypes') -and $null -ne $currentPolicy.IncludeGuestOrExternalUserTypes) { + $IncludeGuestOrExternalUserTypes = $currentPolicy.IncludeGuestOrExternalUserTypes + } if ($IncludeGuestOrExternalUserTypes.Count -ne 0) { $includeGuestsOrExternalUsers = @{} @@ -1245,6 +1284,9 @@ function Set-TargetResource $conditions.Users.Add('includeGuestsOrExternalUsers', $includeGuestsOrExternalUsers) } Write-Verbose -Message 'Set-Targetresource: process excludeGuestsOrExternalUsers' + If (!$currentParameters.ContainsKey('ExcludeGuestOrExternalUserTypes') -and $null -ne $currentPolicy.ExcludeGuestOrExternalUserTypes) { + $ExcludeGuestOrExternalUserTypes = $currentPolicy.ExcludeGuestOrExternalUserTypes + } if ($ExcludeGuestOrExternalUserTypes.Count -ne 0) { $excludeGuestsOrExternalUsers = @{} @@ -1268,6 +1310,14 @@ function Set-TargetResource $conditions.Users.Add('excludeGuestsOrExternalUsers', $excludeGuestsOrExternalUsers) } Write-Verbose -Message 'Set-Targetresource: process platform condition' + if (!$currentParameters.ContainsKey('IncludePlatforms') -and $null -ne $currentPolicy.IncludePlatforms) + { + $IncludePlatforms = $currentPolicy.IncludePlatforms + } + if (!$currentParameters.ContainsKey('ExcludePlatforms') -and $null -ne $currentPolicy.ExcludePlatforms) + { + $ExcludePlatforms = $currentPolicy.ExcludePlatforms + } if ($IncludePlatforms -or $ExcludePlatforms) { #create and provision Platform condition object if used @@ -1303,6 +1353,12 @@ function Set-TargetResource $conditions.Platforms = $null } Write-Verbose -Message 'Set-Targetresource: process include and exclude locations' + if (!$currentParameters.ContainsKey('IncludeLocations') -and $null -ne $currentPolicy.IncludeLocations) { + $IncludeLocations = $currentPolicy.IncludeLocations + } + if (!$currentParameters.ContainsKey('ExcludeLocations') -and $null -ne $currentPolicy.ExcludeLocations) { + $ExcludeLocations = $currentPolicy.ExcludeLocations + } if ($IncludeLocations -or $ExcludeLocations) { $conditions.Add('Locations', @{ @@ -1373,6 +1429,12 @@ function Set-TargetResource } Write-Verbose -Message 'Set-Targetresource: process device filter' + if (!$currentParameters.ContainsKey('DeviceFilterMode') -and $null -ne $currentPolicy.DeviceFilterMode) { + $DeviceFilterMode = $currentPolicy.DeviceFilterMode + } + if (!$currentParameters.ContainsKey('DeviceFilterRule') -and $null -ne $currentPolicy.DeviceFilterRule) { + $DeviceFilterRule = $currentPolicy.DeviceFilterRule + } if ($DeviceFilterMode -and $DeviceFilterRule) { if (-not $conditions.Contains('Devices')) @@ -1414,12 +1476,21 @@ function Set-TargetResource Write-Verbose -Message 'Set-Targetresource: process risk levels and app types' Write-Verbose -Message "Set-Targetresource: UserRiskLevels: $UserRiskLevels" + If (!$currentParameters.ContainsKey('UserRiskLevels') -and $null -ne $currentPolicy.UserRiskLevels) { + $UserRiskLevels = $currentPolicy.UserRiskLevels + } $Conditions.Add('UserRiskLevels', $UserRiskLevels) #no translation or conversion needed Write-Verbose -Message "Set-Targetresource: SignInRiskLevels: $SignInRiskLevels" + If (!$currentParameters.ContainsKey('SignInRiskLevels') -and $null -ne $currentPolicy.SignInRiskLevels) { + $SignInRiskLevels = $currentPolicy.SignInRiskLevels + } $Conditions.Add('SignInRiskLevels', $SignInRiskLevels) #no translation or conversion needed Write-Verbose -Message "Set-Targetresource: ClientAppTypes: $ClientAppTypes" + If (!$currentParameters.ContainsKey('ClientAppTypes') -and $null -ne $currentPolicy.ClientAppTypes) { + $ClientAppTypes = $currentPolicy.ClientAppTypes + } $Conditions.Add('ClientAppTypes', $ClientAppTypes) #no translation or conversion needed Write-Verbose -Message 'Set-Targetresource: Adding processed conditions' From 195142a591022191ea0b97a808e337dfb1b6cb43 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 08:12:57 -0500 Subject: [PATCH 027/122] Fixes for SPOSharingSettings --- CHANGELOG.md | 3 +++ .../MSFT_SPOSharingSettings.psm1 | 4 +++ .../3-Remove.ps1 | 26 ------------------- 3 files changed, 7 insertions(+), 26 deletions(-) delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/3-Remove.ps1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 78bafaa588..bad7eb5a77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ * Removed the ability to specify a value of Absent for the Ensure property. * AADCrossTenantAccessPolicyCOnfigurationDefault * Removed the ability to specify a value of Absent for the Ensure property. +* SPOSharingSettings + * Fixed an Issue where the MySiteSharingCapability could be returned as an + empty string instead of a null value from the Get method. # 1.24.117.1 diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 index a60538c49d..33916b54fb 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 @@ -194,6 +194,10 @@ function Get-TargetResource $DefaultLinkPermission = $SPOSharingSettings.DefaultLinkPermission } + if ([System.String]::IsNullOrEmpty($MySiteSharingCapability)) + { + $MySiteSharingCapability = $null + } return @{ IsSingleInstance = 'Yes' SharingCapability = $SPOSharingSettings.SharingCapability diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/3-Remove.ps1 deleted file mode 100644 index 6ca6f1913c..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/AADAuthenticationMethodPolicyEmail/3-Remove.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyEmail "AADAuthenticationMethodPolicyEmail-Email" - { - Ensure = "Absent"; - Id = "Email"; - State = "disabled"; # Updated Property - Credential = $credsCredential; - } - } -} From bda68c7e92aa25518eefc4e6bb3efdd04f82f7ce Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 08:21:29 -0500 Subject: [PATCH 028/122] Update MSFT_SPOSharingSettings.psm1 --- .../MSFT_SPOSharingSettings.psm1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 index 33916b54fb..b8dd694459 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 @@ -193,15 +193,9 @@ function Get-TargetResource { $DefaultLinkPermission = $SPOSharingSettings.DefaultLinkPermission } - - if ([System.String]::IsNullOrEmpty($MySiteSharingCapability)) - { - $MySiteSharingCapability = $null - } - return @{ + $results = @{ IsSingleInstance = 'Yes' SharingCapability = $SPOSharingSettings.SharingCapability - MySiteSharingCapability = $MySiteSharingCapability ShowEveryoneClaim = $SPOSharingSettings.ShowEveryoneClaim ShowAllUsersClaim = $SPOSharingSettings.ShowAllUsersClaim ShowEveryoneExceptExternalUsersClaim = $SPOSharingSettings.ShowEveryoneExceptExternalUsersClaim @@ -233,6 +227,12 @@ function Get-TargetResource Managedidentity = $ManagedIdentity.IsPresent Ensure = 'Present' } + + if (-not [System.String]::IsNullOrEmpty($MySiteSharingCapability)) + { + $results.Add('MySiteSharingCapability', $MySiteSharingCapability) + } + return $results } catch { From 3c28fdaccdb0d52f8fe2aee563d916098fb52d85 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Fri, 19 Jan 2024 13:49:40 +0000 Subject: [PATCH 029/122] Updated Resources and Cmdlet documentation pages --- .../AADAuthenticationMethodPolicyEmail.md | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md index 45d7db151b..369f220f49 100644 --- a/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md +++ b/docs/docs/resources/azure-ad/AADAuthenticationMethodPolicyEmail.md @@ -114,32 +114,3 @@ Configuration Example } ``` -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - Node localhost - { - AADAuthenticationMethodPolicyEmail "AADAuthenticationMethodPolicyEmail-Email" - { - Ensure = "Absent"; - Id = "Email"; - State = "disabled"; # Updated Property - Credential = $credsCredential; - } - } -} -``` - From bf2478d1695401b59eaa5f7fa32711500addab6f Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 09:22:35 -0500 Subject: [PATCH 030/122] Fix Integration tests of AADGroup --- .../Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 | 2 +- .../Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 index 17397660a0..41f8825460 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 @@ -24,7 +24,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 index 0a2a11f894..7862017a86 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 @@ -23,7 +23,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } From 5b016a74f395efd67bc948f58e85fd15a90912f7 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Fri, 19 Jan 2024 14:24:10 +0000 Subject: [PATCH 031/122] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/azure-ad/AADGroup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/resources/azure-ad/AADGroup.md b/docs/docs/resources/azure-ad/AADGroup.md index 2c56cbc78a..dccb5a9313 100644 --- a/docs/docs/resources/azure-ad/AADGroup.md +++ b/docs/docs/resources/azure-ad/AADGroup.md @@ -98,7 +98,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } @@ -132,7 +132,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } From 3c451b7346abbc6ab02277e94ce8f2cd645cb6f9 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Fri, 19 Jan 2024 14:26:31 +0000 Subject: [PATCH 032/122] Updated {Create} AAD Integration Tests --- .../Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 index e639ffe2c2..4875dab41a 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 @@ -227,7 +227,7 @@ GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } From dd8409b7947763e58d65771b744d629a9553e2fa Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Fri, 19 Jan 2024 14:28:45 +0000 Subject: [PATCH 033/122] Updated {Update} AAD Integration Tests --- .../Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 index ead0477bf2..a7e5141668 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Update.Tests.ps1 @@ -579,7 +579,7 @@ GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } From 11cae9df1b844f90ddd0f65d9da6456e8367590e Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Fri, 19 Jan 2024 14:31:49 +0000 Subject: [PATCH 034/122] Updated {Update} AAD Integration Tests --- .../M365DSCIntegration.AAD.Remove.Tests.ps1 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 index 0c3294cc4d..6415d0c12a 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Remove.Tests.ps1 @@ -53,13 +53,6 @@ State = "enabled"; Credential = $credsCredential; } - AADAuthenticationMethodPolicyEmail 'AADAuthenticationMethodPolicyEmail-Email' - { - Ensure = "Absent"; - Id = "Email"; - State = "disabled"; # Updated Property - Credential = $credsCredential; - } AADAuthenticationMethodPolicyFido2 'AADAuthenticationMethodPolicyFido2-Fido2' { Ensure = "Absent"; From 5946f60271183ad709645d1872ebf7f76becf794 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 09:45:23 -0500 Subject: [PATCH 035/122] AADGroup Integration Fixes --- .../Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 | 2 +- .../Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 index 41f8825460..c8192769e8 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 @@ -24,7 +24,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain", "GitHubIntegration@$Domain") Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 index 7862017a86..9e29f075e3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 @@ -23,7 +23,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain", "GitHubIntegration@$Domain") Ensure = "Present" Credential = $Credscredential } From dc9dd2bb070d2737888997bf12a8af680197afe9 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Fri, 19 Jan 2024 14:46:55 +0000 Subject: [PATCH 036/122] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/azure-ad/AADGroup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/resources/azure-ad/AADGroup.md b/docs/docs/resources/azure-ad/AADGroup.md index dccb5a9313..24fbdfaad8 100644 --- a/docs/docs/resources/azure-ad/AADGroup.md +++ b/docs/docs/resources/azure-ad/AADGroup.md @@ -98,7 +98,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain", "GitHubIntegration@$Domain") Ensure = "Present" Credential = $Credscredential } @@ -132,7 +132,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain", "GitHubIntegration@$Domain") Ensure = "Present" Credential = $Credscredential } From b4f62f057d46cc71c8790397587d304461969365 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Fri, 19 Jan 2024 14:48:51 +0000 Subject: [PATCH 037/122] Updated {Create} AAD Integration Tests --- .../Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 index 4875dab41a..d063a17932 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 @@ -227,7 +227,7 @@ GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain", "GitHubIntegration@$Domain") Ensure = "Present" Credential = $Credscredential } From 838a5b95371057ec168e8a6daa0e78a4ec8f685d Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 10:07:31 -0500 Subject: [PATCH 038/122] Fixes --- .../Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 | 2 +- .../Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 index c8192769e8..41f8825460 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/1-Create.ps1 @@ -24,7 +24,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain", "GitHubIntegration@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 index 9e29f075e3..7862017a86 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/AADGroup/2-Update.ps1 @@ -23,7 +23,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain", "GitHubIntegration@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } From f69052d911f168fd7d762def4177a67c0e4edf2c Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Fri, 19 Jan 2024 15:09:08 +0000 Subject: [PATCH 039/122] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/azure-ad/AADGroup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/resources/azure-ad/AADGroup.md b/docs/docs/resources/azure-ad/AADGroup.md index 24fbdfaad8..dccb5a9313 100644 --- a/docs/docs/resources/azure-ad/AADGroup.md +++ b/docs/docs/resources/azure-ad/AADGroup.md @@ -98,7 +98,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain", "GitHubIntegration@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } @@ -132,7 +132,7 @@ Configuration Example GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain", "GitHubIntegration@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } From ff8cdce03f28a49c91bcccc280dfc1635aa5ec6e Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Fri, 19 Jan 2024 15:10:55 +0000 Subject: [PATCH 040/122] Updated {Create} AAD Integration Tests --- .../Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 index d063a17932..4875dab41a 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.AAD.Create.Tests.ps1 @@ -227,7 +227,7 @@ GroupTypes = @("Unified") MailNickname = "M365DSC" Visibility = "Private" - Owners = @("admin@$Domain", "AdeleV@$Domain", "GitHubIntegration@$Domain") + Owners = @("admin@$Domain", "AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } From a46fcc7c08c7f437921d9909adf14b6ff0d9994e Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 12:47:37 -0500 Subject: [PATCH 041/122] AAD Group Restore from Deleted --- CHANGELOG.md | 3 + .../MSFT_AADGroup/MSFT_AADGroup.psm1 | 56 ++++++++++++++----- 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bad7eb5a77..ce029d2282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ * Removed the ability to specify a value of Absent for the Ensure property. * AADCrossTenantAccessPolicyCOnfigurationDefault * Removed the ability to specify a value of Absent for the Ensure property. +* AADGroup + * Changed Set logic to restore groups from the deleted list if a match by + DisplayName is found. * 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_AADGroup/MSFT_AADGroup.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/MSFT_AADGroup.psm1 index 293ac6fd29..1c9ae1a71b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/MSFT_AADGroup.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/MSFT_AADGroup.psm1 @@ -559,26 +559,44 @@ function Set-TargetResource } elseif ($Ensure -eq 'Present' -and $currentGroup.Ensure -eq 'Absent') { - Write-Verbose -Message "Creating new group {$DisplayName}" - $currentParameters.Remove('Id') | Out-Null + Write-Verbose -Message "Checking to see if an existing deleted group exists with DisplayName {$DisplayName}" + $restorinExisting = $false + [Array]$groups = Get-MgBetaDirectoryDeletedItemAsGroup -Filter "DisplayName eq '$DisplayName'" + if ($groups.Length -gt 1) + { + throw "Multiple deleted groups with the name {$DisplayName} were found. Cannot restore the existig group. Please ensure that you either have no instance of the group in the deleted list or that you have a single one." + } - try + if ($groups.Length -eq 1) + { + Write-Verbose -Message "Found an instance of a deleted group {$DisplayName}. Restoring it." + Restore-MgBetaDirectoryDeletedItem -DirectoryObjectId $groups[0].Id + $restoringExisting = $true + $currentGroup = Get-MgGroup -Filter "DisplayName eq '$DisplayName'" -ErrorAction Stop + } + + if (-not $restoringExisting) { - Write-Verbose -Message "Creating Group with Values: $(Convert-M365DscHashtableToString -Hashtable $currentParameters)" - $currentGroup = New-MgGroup @currentParameters + Write-Verbose -Message "Creating new group {$DisplayName}" + $currentParameters.Remove('Id') | Out-Null - Write-Verbose -Message "Created Group $($currentGroup.id)" - if ($assignedLicensesGUIDs.Length -gt 0) + try { - Set-MgGroupLicense -GroupId $currentGroup.Id -AddLicenses $licensesToAdd -RemoveLicenses @() + Write-Verbose -Message "Creating Group with Values: $(Convert-M365DscHashtableToString -Hashtable $currentParameters)" + $currentGroup = New-MgGroup @currentParameters + Write-Verbose -Message "Created Group $($currentGroup.id)" + } + catch + { + Write-Verbose -Message $_ + New-M365DSCLogEntry -Message "Couldn't create group $DisplayName" ` + -Exception $_ ` + -Source $MyInvocation.MyCommand.ModuleName } } - catch + if ($assignedLicensesGUIDs.Length -gt 0) { - Write-Verbose -Message $_ - New-M365DSCLogEntry -Message "Couldn't create group $DisplayName" ` - -Exception $_ ` - -Source $MyInvocation.MyCommand.ModuleName + Set-MgGroupLicense -GroupId $currentGroup.Id -AddLicenses $licensesToAdd -RemoveLicenses @() } } elseif ($Ensure -eq 'Absent' -and $currentGroup.Ensure -eq 'Present') @@ -623,7 +641,17 @@ function Set-TargetResource $ownerObject = @{ '@odata.id' = "https://graph.microsoft.com/v1.0/users/{$($user.Id)}" } - New-MgGroupOwnerByRef -GroupId ($currentGroup.Id) -BodyParameter $ownerObject | Out-Null + try + { + New-MgGroupOwnerByRef -GroupId ($currentGroup.Id) -BodyParameter $ownerObject -ErrorAction Stop| Out-Null + } + catch + { + if ($_.Exception.Message -notlike "*One or more added object references already exist for the following modified properties*") + { + throw $_ + } + } } elseif ($diff.SideIndicator -eq '<=') { From 15829d52eb2654ce26e7313406c10f0fb4b9b4e9 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 13:12:21 -0500 Subject: [PATCH 042/122] Fixes AADGroup Logic --- .../MSFT_AADGroup/MSFT_AADGroup.psm1 | 86 +++++++++---------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/MSFT_AADGroup.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/MSFT_AADGroup.psm1 index 1c9ae1a71b..a0b411cc71 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/MSFT_AADGroup.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/MSFT_AADGroup.psm1 @@ -511,7 +511,49 @@ function Set-TargetResource $currentParameters.Remove('AssignedLicenses') | Out-Null - if ($Ensure -eq 'Present' -and $currentGroup.Ensure -eq 'Present') + if ($Ensure -eq 'Present' -and $currentGroup.Ensure -eq 'Absent') + { + Write-Verbose -Message "Checking to see if an existing deleted group exists with DisplayName {$DisplayName}" + $restorinExisting = $false + [Array]$groups = Get-MgBetaDirectoryDeletedItemAsGroup -Filter "DisplayName eq '$DisplayName'" + if ($groups.Length -gt 1) + { + throw "Multiple deleted groups with the name {$DisplayName} were found. Cannot restore the existig group. Please ensure that you either have no instance of the group in the deleted list or that you have a single one." + } + + if ($groups.Length -eq 1) + { + Write-Verbose -Message "Found an instance of a deleted group {$DisplayName}. Restoring it." + Restore-MgBetaDirectoryDeletedItem -DirectoryObjectId $groups[0].Id + $restoringExisting = $true + $currentGroup = Get-MgGroup -Filter "DisplayName eq '$DisplayName'" -ErrorAction Stop + } + + if (-not $restoringExisting) + { + Write-Verbose -Message "Creating new group {$DisplayName}" + $currentParameters.Remove('Id') | Out-Null + + try + { + Write-Verbose -Message "Creating Group with Values: $(Convert-M365DscHashtableToString -Hashtable $currentParameters)" + $currentGroup = New-MgGroup @currentParameters + Write-Verbose -Message "Created Group $($currentGroup.id)" + } + catch + { + Write-Verbose -Message $_ + New-M365DSCLogEntry -Message "Couldn't create group $DisplayName" ` + -Exception $_ ` + -Source $MyInvocation.MyCommand.ModuleName + } + } + if ($assignedLicensesGUIDs.Length -gt 0) + { + Set-MgGroupLicense -GroupId $currentGroup.Id -AddLicenses $licensesToAdd -RemoveLicenses @() + } + } + if ($Ensure -eq 'Present') { Write-Verbose -Message "Group {$DisplayName} exists and it should." try @@ -557,48 +599,6 @@ function Set-TargetResource -Source $MyInvocation.MyCommand.ModuleName } } - elseif ($Ensure -eq 'Present' -and $currentGroup.Ensure -eq 'Absent') - { - Write-Verbose -Message "Checking to see if an existing deleted group exists with DisplayName {$DisplayName}" - $restorinExisting = $false - [Array]$groups = Get-MgBetaDirectoryDeletedItemAsGroup -Filter "DisplayName eq '$DisplayName'" - if ($groups.Length -gt 1) - { - throw "Multiple deleted groups with the name {$DisplayName} were found. Cannot restore the existig group. Please ensure that you either have no instance of the group in the deleted list or that you have a single one." - } - - if ($groups.Length -eq 1) - { - Write-Verbose -Message "Found an instance of a deleted group {$DisplayName}. Restoring it." - Restore-MgBetaDirectoryDeletedItem -DirectoryObjectId $groups[0].Id - $restoringExisting = $true - $currentGroup = Get-MgGroup -Filter "DisplayName eq '$DisplayName'" -ErrorAction Stop - } - - if (-not $restoringExisting) - { - Write-Verbose -Message "Creating new group {$DisplayName}" - $currentParameters.Remove('Id') | Out-Null - - try - { - Write-Verbose -Message "Creating Group with Values: $(Convert-M365DscHashtableToString -Hashtable $currentParameters)" - $currentGroup = New-MgGroup @currentParameters - Write-Verbose -Message "Created Group $($currentGroup.id)" - } - catch - { - Write-Verbose -Message $_ - New-M365DSCLogEntry -Message "Couldn't create group $DisplayName" ` - -Exception $_ ` - -Source $MyInvocation.MyCommand.ModuleName - } - } - if ($assignedLicensesGUIDs.Length -gt 0) - { - Set-MgGroupLicense -GroupId $currentGroup.Id -AddLicenses $licensesToAdd -RemoveLicenses @() - } - } elseif ($Ensure -eq 'Absent' -and $currentGroup.Ensure -eq 'Present') { try From cbe00aba3e6647762846859e4de656be27a947d9 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 14:14:48 -0500 Subject: [PATCH 043/122] Fixes --- .../Microsoft365DSC.AADGroup.Tests.ps1 | 8 +++++++- Tests/Unit/Stubs/Microsoft365.psm1 | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 index be6fd42cef..27ffcd81bc 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 @@ -37,6 +37,12 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-MgGroupMember -MockWith { } + Mock -CommandName Restore-MgBetaDirectoryDeletedItem -MockWith { + } + + Mock -CommandName Get-MgBetaDirectoryDeletedItem -MockWith { + } + Mock -CommandName Get-MgGroupMemberOf -MockWith { } @@ -395,7 +401,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { MailNickname = 'M365DSC' GroupTypes = @() } - + # Set-TargetResource expects object-type of answer to contain 'group' $returnData.psobject.TypeNames.insert(0, 'Group') return $returnData diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index f5544b9f0f..9280d71b9c 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -1,4 +1,4 @@ -#region ExchangeOnlineManagement +# region ExchangeOnlineManagement function Get-DefaultTenantBriefingConfig { [CmdletBinding()] @@ -51825,6 +51825,20 @@ function Remove-MgBetaDirectoryAdministrativeUnitMemberByRef $Break ) } +function Restore-MgBetaDirectoryDeletedItem +{ + [CmdletBinding()] + param( + [Parameter()] + [String] + $DirectoryObjectId + ) +} +function Get-MgBetaDirectoryDeletedItem +{ + [CmdletBinding()] +} + function Remove-MgBetaDirectoryAdministrativeUnitScopedRoleMember { [CmdletBinding()] From 5a3ddf68f4ef2c7a53b92a4c0485b8d4a6dc37f5 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 14:22:24 -0500 Subject: [PATCH 044/122] Update Microsoft365.psm1 --- Tests/Unit/Stubs/Microsoft365.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index 9280d71b9c..f0614e47d1 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -51837,6 +51837,7 @@ function Restore-MgBetaDirectoryDeletedItem function Get-MgBetaDirectoryDeletedItem { [CmdletBinding()] + param() } function Remove-MgBetaDirectoryAdministrativeUnitScopedRoleMember From 0438cda4b4309685433aaccbb2b5ec0124dd5215 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 14:36:21 -0500 Subject: [PATCH 045/122] Fixes --- .../Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 | 2 ++ Tests/Unit/Stubs/Microsoft365.psm1 | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 index 27ffcd81bc..115cf92bd1 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 @@ -39,6 +39,8 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Restore-MgBetaDirectoryDeletedItem -MockWith { } + Mock -CommandName Get-MgBetaDirectoryDeletedItemAsGroup -MockWith { + } Mock -CommandName Get-MgBetaDirectoryDeletedItem -MockWith { } diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index f0614e47d1..af4f47bb78 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -51840,6 +51840,16 @@ function Get-MgBetaDirectoryDeletedItem param() } +function Get-MgBetaDirectoryDeletedItem +{ + [CmdletBinding()] + param( + [Parameter()] + [String] + $Filter + ) +} + function Remove-MgBetaDirectoryAdministrativeUnitScopedRoleMember { [CmdletBinding()] From 88326f9350627cbfef103022ad2dec62721ecdf8 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Fri, 19 Jan 2024 14:44:46 -0500 Subject: [PATCH 046/122] Fixes --- .../Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 | 3 --- Tests/Unit/Stubs/Microsoft365.psm1 | 7 +------ 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 index 115cf92bd1..a07cd9c6d9 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADGroup.Tests.ps1 @@ -42,9 +42,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-MgBetaDirectoryDeletedItemAsGroup -MockWith { } - Mock -CommandName Get-MgBetaDirectoryDeletedItem -MockWith { - } - Mock -CommandName Get-MgGroupMemberOf -MockWith { } diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index af4f47bb78..dc213dcafb 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -51834,13 +51834,8 @@ function Restore-MgBetaDirectoryDeletedItem $DirectoryObjectId ) } -function Get-MgBetaDirectoryDeletedItem -{ - [CmdletBinding()] - param() -} -function Get-MgBetaDirectoryDeletedItem +function Get-MgBetaDirectoryDeletedItemAsGroup { [CmdletBinding()] param( From 0f3854ed621514f4300e37ee95dd15fe86a2155c Mon Sep 17 00:00:00 2001 From: Michael Barmettler <99532854+mibarm@users.noreply.github.com> Date: Mon, 22 Jan 2024 08:00:10 +0100 Subject: [PATCH 047/122] add test and check params --- .../MSFT_AADConditionalAccessPolicy.psm1 | 743 +++++++++--------- ...65DSC.AADConditionalAccessPolicy.Tests.ps1 | 118 +++ 2 files changed, 486 insertions(+), 375 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 index 7dbfcd0e43..7f3e7c076f 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADConditionalAccessPolicy/MSFT_AADConditionalAccessPolicy.psm1 @@ -954,22 +954,14 @@ function Set-TargetResource } #create and provision Application Condition object Write-Verbose -Message 'Set-Targetresource: create Application Condition object' - if ($IncludeApplications) + if ($currentParameters.ContainsKey("IncludeApplications")) { $conditions.Applications.Add('IncludeApplications', $IncludeApplications) } - else - { - $conditions.Applications.Add('IncludeApplications', $currentPolicy.IncludeApplications) - } if ($currentParameters.ContainsKey("ExcludeApplications")) { $conditions.Applications.Add('ExcludeApplications', $ExcludeApplications) } - else - { - $conditions.Applications.Add('ExcludeApplications', $currentPolicy.ExcludeApplications) - } if ($ApplicationsFilter -and $ApplicationsFilterMode) { $appFilterValue = @{ @@ -978,19 +970,10 @@ function Set-TargetResource } $conditions.Applications.Add("ApplicationFilter", $appFilterValue) } - else - { - $conditions.Applications.Add("ApplicationFilter", $currentPolicy.ApplicationsFilter) - } - if ($IncludeUserActions) { $conditions.Applications.Add('IncludeUserActions', $IncludeUserActions) } - else - { - $conditions.Applications.Add('IncludeUserActions', $currentPolicy.IncludeUserActions) - } if ($AuthenticationContexts) { # Retrieve the class reference based on display name. @@ -1009,21 +992,108 @@ function Set-TargetResource #create and provision User Condition object Write-Verbose -Message 'Set-Targetresource: process includeusers' - if (!$currentParameters.ContainsKey('IncludeUsers') -and $null -ne $currentPolicy.IncludeUsers) { - $IncludeUsers = $currentPolicy.IncludeUsers + if ($currentParameters.ContainsKey('IncludeUsers')) + { + $conditions.Users.Add('IncludeUsers', @()) + foreach ($includeuser in $IncludeUsers) + { + #translate user UPNs to GUID, except id value is GuestsOrExternalUsers, None or All + if ($includeuser) + { + if ($includeuser -notin 'GuestsOrExternalUsers', 'All', 'None') + { + $userguid = $null + try + { + $userguid = (Get-MgUser -UserId $includeuser).Id + } + catch + { + New-M365DSCLogEntry -Message 'Error updating data:' ` + -Exception $_ ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + if ($null -eq $userguid) + { + $message = "Couldn't find user $includeuser , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Users.IncludeUsers += $userguid + } + } + else + { + $conditions.Users.IncludeUsers += $includeuser + } + } + } + } + + Write-Verbose -Message 'Set-Targetresource: process excludeusers' + if ($currentParameters.ContainsKey('ExcludeUsers')) + { + $conditions.Users.Add('ExcludeUsers', @()) + foreach ($excludeuser in $ExcludeUsers) + { + #translate user UPNs to GUID, except id value is GuestsOrExternalUsers, None or All + if ($excludeuser) + { + if ($excludeuser -notin 'GuestsOrExternalUsers', 'All', 'None') + { + $userguid = $null + try + { + $userguid = (Get-MgUser -UserId $excludeuser).Id + } + catch + { + New-M365DSCLogEntry -Message 'Error updating data:' ` + -Exception $_ ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + if ($null -eq $userguid) + { + $message = "Couldn't find user $excludeuser , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Users.ExcludeUsers += $userguid + } + } + else + { + $conditions.Users.ExcludeUsers += $excludeuser + } + } + } } - $conditions.Users.Add('IncludeUsers', @()) - foreach ($includeuser in $IncludeUsers) + + Write-Verbose -Message 'Set-Targetresource: process includegroups' + if ($currentParameters.ContainsKey('IncludeGroups')) { - #translate user UPNs to GUID, except id value is GuestsOrExternalUsers, None or All - if ($includeuser) + $conditions.Users.Add('IncludeGroups', @()) + foreach ($includegroup in $IncludeGroups) { - if ($includeuser -notin 'GuestsOrExternalUsers', 'All', 'None') + #translate user Group names to GUID + if ($includegroup) { - $userguid = $null + $GroupLookup = $null try { - $userguid = (Get-MgUser -UserId $includeuser).Id + $GroupLookup = Get-MgGroup -Filter "DisplayName eq '$includegroup'" } catch { @@ -1033,9 +1103,17 @@ function Set-TargetResource -TenantId $TenantId ` -Credential $Credential } - if ($null -eq $userguid) + if ($GroupLookup.Length -gt 1) { - $message = "Couldn't find user $includeuser , couldn't add to policy $DisplayName" + $message = "Duplicate group found with displayname $includegroup , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + elseif ($null -eq $GroupLookup) + { + $message = "Couldn't find group $includegroup , couldn't add to policy $DisplayName" New-M365DSCLogEntry -Message $message ` -Source $($MyInvocation.MyCommand.Source) ` -TenantId $TenantId ` @@ -1043,32 +1121,26 @@ function Set-TargetResource } else { - $conditions.Users.IncludeUsers += $userguid + Write-Verbose -Message 'adding group to includegroups' + $conditions.Users.IncludeGroups += $GroupLookup.Id } } - else - { - $conditions.Users.IncludeUsers += $includeuser - } } } - Write-Verbose -Message 'Set-Targetresource: process excludeusers' - if (!$currentParameters.ContainsKey('ExcludeUsers') -and $null -ne $currentPolicy.ExcludeUsers) { - $ExcludeUsers = $currentPolicy.ExcludeUsers - } - $conditions.Users.Add('ExcludeUsers', @()) - foreach ($excludeuser in $ExcludeUsers) + Write-Verbose -Message 'Set-Targetresource: process excludegroups' + if ($currentParameters.ContainsKey('ExcludeGroups')) { - #translate user UPNs to GUID, except id value is GuestsOrExternalUsers, None or All - if ($excludeuser) + $conditions.Users.Add('ExcludeGroups', @()) + foreach ($ExcludeGroup in $ExcludeGroups) { - if ($excludeuser -notin 'GuestsOrExternalUsers', 'All', 'None') + #translate user Group names to GUID + if ($ExcludeGroup) { - $userguid = $null + $GroupLookup = $null try { - $userguid = (Get-MgUser -UserId $excludeuser).Id + $GroupLookup = Get-MgGroup -Filter "DisplayName eq '$ExcludeGroup'" } catch { @@ -1078,9 +1150,17 @@ function Set-TargetResource -TenantId $TenantId ` -Credential $Credential } - if ($null -eq $userguid) + if ($GroupLookup.Length -gt 1) + { + $message = "Duplicate group found with displayname $ExcludeGroup , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + elseif ($null -eq $GroupLookup) { - $message = "Couldn't find user $excludeuser , couldn't add to policy $DisplayName" + $message = "Couldn't find group $ExcludeGroup , couldn't add to policy $DisplayName" New-M365DSCLogEntry -Message $message ` -Source $($MyInvocation.MyCommand.Source) ` -TenantId $TenantId ` @@ -1088,387 +1168,283 @@ function Set-TargetResource } else { - $conditions.Users.ExcludeUsers += $userguid + Write-Verbose -Message 'adding group to ExcludeGroups' + $conditions.Users.ExcludeGroups += $GroupLookup.Id } } - else - { - $conditions.Users.ExcludeUsers += $excludeuser - } } } - Write-Verbose -Message 'Set-Targetresource: process includegroups' - if (!$currentParameters.ContainsKey('IncludeGroups') -and $null -ne $currentPolicy.IncludeGroups) { - $IncludeGroups = $currentPolicy.IncludeGroups - } - $conditions.Users.Add('IncludeGroups', @()) - foreach ($includegroup in $IncludeGroups) + + Write-Verbose -Message 'Set-Targetresource: process includeroles' + if ($currentParameters.ContainsKey('IncludeRoles')) { - #translate user Group names to GUID - if ($includegroup) + $conditions.Users.Add('IncludeRoles', @()) + if ($IncludeRoles) { - $GroupLookup = $null - try - { - $GroupLookup = Get-MgGroup -Filter "DisplayName eq '$includegroup'" - } - catch - { - New-M365DSCLogEntry -Message 'Error updating data:' ` - -Exception $_ ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential - } - if ($GroupLookup.Length -gt 1) + #translate role names to template guid if defined + $rolelookup = @{} + foreach ($role in Get-MgBetaDirectoryRoleTemplate) { - $message = "Duplicate group found with displayname $includegroup , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential + $rolelookup[$role.DisplayName] = $role.Id } - elseif ($null -eq $GroupLookup) + foreach ($IncludeRole in $IncludeRoles) { - $message = "Couldn't find group $includegroup , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential - } - else - { - Write-Verbose -Message 'adding group to includegroups' - $conditions.Users.IncludeGroups += $GroupLookup.Id + if ($IncludeRole) + { + if ($null -eq $rolelookup[$IncludeRole]) + { + $message = "Couldn't find role $IncludeRole , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Users.IncludeRoles += $rolelookup[$IncludeRole] + } + } } } } - Write-Verbose -Message 'Set-Targetresource: process excludegroups' - if (!$currentParameters.ContainsKey('ExcludeGroups') -and $null -ne $currentPolicy.ExcludeGroups) { - $ExcludeGroups = $currentPolicy.ExcludeGroups - } - $conditions.Users.Add('ExcludeGroups', @()) - foreach ($ExcludeGroup in $ExcludeGroups) + Write-Verbose -Message 'Set-Targetresource: process excluderoles' + if ($currentParameters.ContainsKey('ExcludeRoles')) { - #translate user Group names to GUID - if ($ExcludeGroup) + $conditions.Users.Add('ExcludeRoles', @()) + if ($ExcludeRoles) { - $GroupLookup = $null - try + #translate role names to template guid if defined + $rolelookup = @{} + foreach ($role in Get-MgBetaDirectoryRoleTemplate) { - $GroupLookup = Get-MgGroup -Filter "DisplayName eq '$ExcludeGroup'" + $rolelookup[$role.DisplayName] = $role.Id } - catch + foreach ($ExcludeRole in $ExcludeRoles) { - New-M365DSCLogEntry -Message 'Error updating data:' ` - -Exception $_ ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential + if ($ExcludeRole) + { + if ($null -eq $rolelookup[$ExcludeRole]) + { + $message = "Couldn't find role $ExcludeRole , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Users.ExcludeRoles += $rolelookup[$ExcludeRole] + } + } } - if ($GroupLookup.Length -gt 1) + } + } + + Write-Verbose -Message 'Set-Targetresource: process includeGuestOrExternalUser' + If ($currentParameters.ContainsKey('IncludeGuestOrExternalUserTypes')) + { + if ($IncludeGuestOrExternalUserTypes.Count -ne 0) + { + $includeGuestsOrExternalUsers = @{} + [string]$IncludeGuestOrExternalUserTypes = $IncludeGuestOrExternalUserTypes -join ',' + $includeGuestsOrExternalUsers.Add('guestOrExternalUserTypes', $IncludeGuestOrExternalUserTypes) + $externalTenants = @{} + if ($IncludeExternalTenantsMembershipKind -eq 'All') { - $message = "Duplicate group found with displayname $ExcludeGroup , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential + $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessAllExternalTenants') } - elseif ($null -eq $GroupLookup) + elseif ($IncludeExternalTenantsMembershipKind -eq 'enumerated') { - $message = "Couldn't find group $ExcludeGroup , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential + $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessEnumeratedExternalTenants') } - else + $externalTenants.Add('membershipKind', $IncludeExternalTenantsMembershipKind) + if ($IncludeExternalTenantsMembers) { - Write-Verbose -Message 'adding group to ExcludeGroups' - $conditions.Users.ExcludeGroups += $GroupLookup.Id + $externalTenants.Add('members', $IncludeExternalTenantsMembers) } + $includeGuestsOrExternalUsers.Add('externalTenants', $externalTenants) + $conditions.Users.Add('includeGuestsOrExternalUsers', $includeGuestsOrExternalUsers) } } - Write-Verbose -Message 'Set-Targetresource: process includeroles' - if (!$currentParameters.ContainsKey('IncludeRoles') -and $null -ne $currentPolicy.IncludeRoles) { - $IncludeRoles = $currentPolicy.IncludeRoles - } - $conditions.Users.Add('IncludeRoles', @()) - if ($IncludeRoles) + Write-Verbose -Message 'Set-Targetresource: process excludeGuestsOrExternalUsers' + If ($currentParameters.ContainsKey('ExcludeGuestOrExternalUserTypes')) { - #translate role names to template guid if defined - $rolelookup = @{} - foreach ($role in Get-MgBetaDirectoryRoleTemplate) - { - $rolelookup[$role.DisplayName] = $role.Id - } - foreach ($IncludeRole in $IncludeRoles) + if ($ExcludeGuestOrExternalUserTypes.Count -ne 0) { - if ($IncludeRole) + $excludeGuestsOrExternalUsers = @{} + [string]$ExcludeGuestOrExternalUserTypes = $ExcludeGuestOrExternalUserTypes -join ',' + $excludeGuestsOrExternalUsers.Add('guestOrExternalUserTypes', $ExcludeGuestOrExternalUserTypes) + $externalTenants = @{} + if ($ExcludeExternalTenantsMembershipKind -eq 'All') { - if ($null -eq $rolelookup[$IncludeRole]) - { - $message = "Couldn't find role $IncludeRole , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential - } - else - { - $conditions.Users.IncludeRoles += $rolelookup[$IncludeRole] - } + $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessAllExternalTenants') } - } - } - - Write-Verbose -Message 'Set-Targetresource: process excluderoles' - if (!$currentParameters.ContainsKey('ExcludeRoles') -and $null -ne $currentPolicy.ExcludeRoles) { - $ExcludeRoles = $currentPolicy.ExcludeRoles - } - $conditions.Users.Add('ExcludeRoles', @()) - if ($ExcludeRoles) - { - #translate role names to template guid if defined - $rolelookup = @{} - foreach ($role in Get-MgBetaDirectoryRoleTemplate) - { - $rolelookup[$role.DisplayName] = $role.Id - } - foreach ($ExcludeRole in $ExcludeRoles) - { - if ($ExcludeRole) + elseif ($ExcludeExternalTenantsMembershipKind -eq 'enumerated') { - if ($null -eq $rolelookup[$ExcludeRole]) - { - $message = "Couldn't find role $ExcludeRole , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential - } - else - { - $conditions.Users.ExcludeRoles += $rolelookup[$ExcludeRole] - } - + $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessEnumeratedExternalTenants') } + $externalTenants.Add('membershipKind', $ExcludeExternalTenantsMembershipKind) + if ($ExcludeExternalTenantsMembers) + { + $externalTenants.Add('members', $ExcludeExternalTenantsMembers) + } + $excludeGuestsOrExternalUsers.Add('externalTenants', $externalTenants) + $conditions.Users.Add('excludeGuestsOrExternalUsers', $excludeGuestsOrExternalUsers) } } - Write-Verbose -Message 'Set-Targetresource: process includeGuestOrExternalUser' - If (!$currentParameters.ContainsKey('IncludeGuestOrExternalUserTypes') -and $null -ne $currentPolicy.IncludeGuestOrExternalUserTypes) { - $IncludeGuestOrExternalUserTypes = $currentPolicy.IncludeGuestOrExternalUserTypes - } - if ($IncludeGuestOrExternalUserTypes.Count -ne 0) - { - $includeGuestsOrExternalUsers = @{} - [string]$IncludeGuestOrExternalUserTypes = $IncludeGuestOrExternalUserTypes -join ',' - $includeGuestsOrExternalUsers.Add('guestOrExternalUserTypes', $IncludeGuestOrExternalUserTypes) - $externalTenants = @{} - if ($IncludeExternalTenantsMembershipKind -eq 'All') - { - $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessAllExternalTenants') - } - elseif ($IncludeExternalTenantsMembershipKind -eq 'enumerated') - { - $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessEnumeratedExternalTenants') - } - $externalTenants.Add('membershipKind', $IncludeExternalTenantsMembershipKind) - if ($IncludeExternalTenantsMembers) - { - $externalTenants.Add('members', $IncludeExternalTenantsMembers) - } - $includeGuestsOrExternalUsers.Add('externalTenants', $externalTenants) - $conditions.Users.Add('includeGuestsOrExternalUsers', $includeGuestsOrExternalUsers) - } - Write-Verbose -Message 'Set-Targetresource: process excludeGuestsOrExternalUsers' - If (!$currentParameters.ContainsKey('ExcludeGuestOrExternalUserTypes') -and $null -ne $currentPolicy.ExcludeGuestOrExternalUserTypes) { - $ExcludeGuestOrExternalUserTypes = $currentPolicy.ExcludeGuestOrExternalUserTypes - } - if ($ExcludeGuestOrExternalUserTypes.Count -ne 0) - { - $excludeGuestsOrExternalUsers = @{} - [string]$ExcludeGuestOrExternalUserTypes = $ExcludeGuestOrExternalUserTypes -join ',' - $excludeGuestsOrExternalUsers.Add('guestOrExternalUserTypes', $ExcludeGuestOrExternalUserTypes) - $externalTenants = @{} - if ($ExcludeExternalTenantsMembershipKind -eq 'All') - { - $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessAllExternalTenants') - } - elseif ($ExcludeExternalTenantsMembershipKind -eq 'enumerated') - { - $externalTenants.Add('@odata.type', '#microsoft.graph.conditionalAccessEnumeratedExternalTenants') - } - $externalTenants.Add('membershipKind', $ExcludeExternalTenantsMembershipKind) - if ($ExcludeExternalTenantsMembers) - { - $externalTenants.Add('members', $ExcludeExternalTenantsMembers) - } - $excludeGuestsOrExternalUsers.Add('externalTenants', $externalTenants) - $conditions.Users.Add('excludeGuestsOrExternalUsers', $excludeGuestsOrExternalUsers) - } + Write-Verbose -Message 'Set-Targetresource: process platform condition' - if (!$currentParameters.ContainsKey('IncludePlatforms') -and $null -ne $currentPolicy.IncludePlatforms) - { - $IncludePlatforms = $currentPolicy.IncludePlatforms - } - if (!$currentParameters.ContainsKey('ExcludePlatforms') -and $null -ne $currentPolicy.ExcludePlatforms) - { - $ExcludePlatforms = $currentPolicy.ExcludePlatforms - } - if ($IncludePlatforms -or $ExcludePlatforms) + if ($currentParameters.ContainsKey('IncludePlatforms') -or $currentParameters.ContainsKey('ExcludePlatforms')) { - #create and provision Platform condition object if used - if (-not $conditions.Contains('Platforms')) - { - $conditions.Add('Platforms', @{ - ExcludePlatforms = @() - IncludePlatforms = @() - }) - } - else - { - $conditions.Platforms.Add('ExcludePlatforms', @()) - $conditions.Platforms.Add('IncludePlatforms', @()) - } - Write-Verbose -Message "Set-Targetresource: IncludePlatforms: $IncludePlatforms" - if (([Array]$IncludePlatforms).Length -eq 0) + if ($IncludePlatforms -or $ExcludePlatforms) { - $conditions.Platforms.IncludePlatforms = @('all') + #create and provision Platform condition object if used + if (-not $conditions.Contains('Platforms')) + { + $conditions.Add('Platforms', @{ + ExcludePlatforms = @() + IncludePlatforms = @() + }) + } + else + { + $conditions.Platforms.Add('ExcludePlatforms', @()) + $conditions.Platforms.Add('IncludePlatforms', @()) + } + Write-Verbose -Message "Set-Targetresource: IncludePlatforms: $IncludePlatforms" + if (([Array]$IncludePlatforms).Length -eq 0) + { + $conditions.Platforms.IncludePlatforms = @('all') + } + else + { + $conditions.Platforms.IncludePlatforms = @() + $IncludePlatforms + } + #no translation or conversion needed + Write-Verbose -Message "Set-Targetresource: ExcludePlatforms: $ExcludePlatforms" + $conditions.Platforms.ExcludePlatforms = @() + $ExcludePlatforms + #no translation or conversion needed } else { - $conditions.Platforms.IncludePlatforms = @() + $IncludePlatforms + Write-Verbose -Message 'Set-Targetresource: setting platform condition to null' + $conditions.Platforms = $null } - #no translation or conversion needed - Write-Verbose -Message "Set-Targetresource: ExcludePlatforms: $ExcludePlatforms" - $conditions.Platforms.ExcludePlatforms = @() + $ExcludePlatforms - #no translation or conversion needed - } - else - { - Write-Verbose -Message 'Set-Targetresource: setting platform condition to null' - $conditions.Platforms = $null } + Write-Verbose -Message 'Set-Targetresource: process include and exclude locations' - if (!$currentParameters.ContainsKey('IncludeLocations') -and $null -ne $currentPolicy.IncludeLocations) { - $IncludeLocations = $currentPolicy.IncludeLocations - } - if (!$currentParameters.ContainsKey('ExcludeLocations') -and $null -ne $currentPolicy.ExcludeLocations) { - $ExcludeLocations = $currentPolicy.ExcludeLocations - } - if ($IncludeLocations -or $ExcludeLocations) + if ($currentParameters.ContainsKey('IncludeLocations') -or $currentParameters.ContainsKey('ExcludeLocations')) { - $conditions.Add('Locations', @{ - ExcludeLocations = @() - IncludeLocations = @() - }) - $conditions.Locations.IncludeLocations = @() - $conditions.Locations.ExcludeLocations = @() - Write-Verbose -Message 'Set-Targetresource: locations specified' - #create and provision Location condition object if used, translate Location names to guid - $LocationLookup = @{} - foreach ($Location in Get-MgBetaIdentityConditionalAccessNamedLocation) - { - $LocationLookup[$Location.DisplayName] = $Location.Id - } - foreach ($IncludeLocation in $IncludeLocations) + if ($IncludeLocations -or $ExcludeLocations) { - if ($IncludeLocation) + $conditions.Add('Locations', @{ + ExcludeLocations = @() + IncludeLocations = @() + }) + $conditions.Locations.IncludeLocations = @() + $conditions.Locations.ExcludeLocations = @() + Write-Verbose -Message 'Set-Targetresource: locations specified' + #create and provision Location condition object if used, translate Location names to guid + $LocationLookup = @{} + foreach ($Location in Get-MgBetaIdentityConditionalAccessNamedLocation) { - if ($IncludeLocation -in 'All', 'AllTrusted') - { - $conditions.Locations.IncludeLocations += $IncludeLocation - } - elseif ($IncludeLocation -eq 'Multifactor authentication trusted IPs') - { - $conditions.Locations.IncludeLocations += '00000000-0000-0000-0000-000000000000' - } - elseif ($null -eq $LocationLookup[$IncludeLocation]) - { - $message = "Couldn't find Location $IncludeLocation , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential - } - else - { - $conditions.Locations.IncludeLocations += $LocationLookup[$IncludeLocation] - } + $LocationLookup[$Location.DisplayName] = $Location.Id } - } - foreach ($ExcludeLocation in $ExcludeLocations) - { - if ($ExcludeLocation) + foreach ($IncludeLocation in $IncludeLocations) { - if ($ExcludeLocation -eq 'All' -or $ExcludeLocation -eq 'AllTrusted') - { - $conditions.Locations.ExcludeLocations += $ExcludeLocation - } - elseif ($ExcludeLocation -eq 'Multifactor authentication trusted IPs') + if ($IncludeLocation) { - $conditions.Locations.ExcludeLocations += '00000000-0000-0000-0000-000000000000' - } - elseif ($null -eq $LocationLookup[$ExcludeLocation]) - { - $message = "Couldn't find Location $ExcludeLocation , couldn't add to policy $DisplayName" - New-M365DSCLogEntry -Message $message ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential + if ($IncludeLocation -in 'All', 'AllTrusted') + { + $conditions.Locations.IncludeLocations += $IncludeLocation + } + elseif ($IncludeLocation -eq 'Multifactor authentication trusted IPs') + { + $conditions.Locations.IncludeLocations += '00000000-0000-0000-0000-000000000000' + } + elseif ($null -eq $LocationLookup[$IncludeLocation]) + { + $message = "Couldn't find Location $IncludeLocation , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Locations.IncludeLocations += $LocationLookup[$IncludeLocation] + } } - else + } + foreach ($ExcludeLocation in $ExcludeLocations) + { + if ($ExcludeLocation) { - $conditions.Locations.ExcludeLocations += $LocationLookup[$ExcludeLocation] + if ($ExcludeLocation -eq 'All' -or $ExcludeLocation -eq 'AllTrusted') + { + $conditions.Locations.ExcludeLocations += $ExcludeLocation + } + elseif ($ExcludeLocation -eq 'Multifactor authentication trusted IPs') + { + $conditions.Locations.ExcludeLocations += '00000000-0000-0000-0000-000000000000' + } + elseif ($null -eq $LocationLookup[$ExcludeLocation]) + { + $message = "Couldn't find Location $ExcludeLocation , couldn't add to policy $DisplayName" + New-M365DSCLogEntry -Message $message ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + } + else + { + $conditions.Locations.ExcludeLocations += $LocationLookup[$ExcludeLocation] + } } } } } Write-Verbose -Message 'Set-Targetresource: process device filter' - if (!$currentParameters.ContainsKey('DeviceFilterMode') -and $null -ne $currentPolicy.DeviceFilterMode) { - $DeviceFilterMode = $currentPolicy.DeviceFilterMode - } - if (!$currentParameters.ContainsKey('DeviceFilterRule') -and $null -ne $currentPolicy.DeviceFilterRule) { - $DeviceFilterRule = $currentPolicy.DeviceFilterRule - } - if ($DeviceFilterMode -and $DeviceFilterRule) + if ($currentParameters.ContainsKey('DeviceFilterMode') -and $currentParameters.ContainsKey('DeviceFilterRule')) { - if (-not $conditions.Contains('Devices')) + if ($DeviceFilterMode -and $DeviceFilterRule) { - $conditions.Add('Devices', @{}) - $conditions.Devices.Add('DeviceFilter', @{}) - $conditions.Devices.DeviceFilter.Add('Mode', $DeviceFilterMode) - $conditions.Devices.DeviceFilter.Add('Rule', $DeviceFilterRule) - } - else - { - if (-not $conditions.Devices.Contains('DeviceFilter')) + if (-not $conditions.Contains('Devices')) { + $conditions.Add('Devices', @{}) $conditions.Devices.Add('DeviceFilter', @{}) $conditions.Devices.DeviceFilter.Add('Mode', $DeviceFilterMode) $conditions.Devices.DeviceFilter.Add('Rule', $DeviceFilterRule) } else { - if (-not $conditions.Devices.DeviceFilter.Contains('Mode')) + if (-not $conditions.Devices.Contains('DeviceFilter')) { + $conditions.Devices.Add('DeviceFilter', @{}) $conditions.Devices.DeviceFilter.Add('Mode', $DeviceFilterMode) - } - else - { - $conditions.Devices.DeviceFilter.Mode = $DeviceFilterMode - } - if (-not $conditions.Devices.DeviceFilter.Contains('Rule')) - { $conditions.Devices.DeviceFilter.Add('Rule', $DeviceFilterRule) } else { - $conditions.Devices.DeviceFilter.Rule = $DeviceFilterRule + if (-not $conditions.Devices.DeviceFilter.Contains('Mode')) + { + $conditions.Devices.DeviceFilter.Add('Mode', $DeviceFilterMode) + } + else + { + $conditions.Devices.DeviceFilter.Mode = $DeviceFilterMode + } + if (-not $conditions.Devices.DeviceFilter.Contains('Rule')) + { + $conditions.Devices.DeviceFilter.Add('Rule', $DeviceFilterRule) + } + else + { + $conditions.Devices.DeviceFilter.Rule = $DeviceFilterRule + } } } } @@ -1476,23 +1452,27 @@ function Set-TargetResource Write-Verbose -Message 'Set-Targetresource: process risk levels and app types' Write-Verbose -Message "Set-Targetresource: UserRiskLevels: $UserRiskLevels" - If (!$currentParameters.ContainsKey('UserRiskLevels') -and $null -ne $currentPolicy.UserRiskLevels) { - $UserRiskLevels = $currentPolicy.UserRiskLevels + If ($currentParameters.ContainsKey('UserRiskLevels')) + { + $Conditions.Add('UserRiskLevels', $UserRiskLevels) + #no translation or conversion needed } - $Conditions.Add('UserRiskLevels', $UserRiskLevels) - #no translation or conversion needed + + Write-Verbose -Message "Set-Targetresource: SignInRiskLevels: $SignInRiskLevels" - If (!$currentParameters.ContainsKey('SignInRiskLevels') -and $null -ne $currentPolicy.SignInRiskLevels) { - $SignInRiskLevels = $currentPolicy.SignInRiskLevels + If ($currentParameters.ContainsKey('SignInRiskLevels')) + { + $Conditions.Add('SignInRiskLevels', $SignInRiskLevels) + #no translation or conversion needed } - $Conditions.Add('SignInRiskLevels', $SignInRiskLevels) - #no translation or conversion needed + + Write-Verbose -Message "Set-Targetresource: ClientAppTypes: $ClientAppTypes" - If (!$currentParameters.ContainsKey('ClientAppTypes') -and $null -ne $currentPolicy.ClientAppTypes) { - $ClientAppTypes = $currentPolicy.ClientAppTypes + If ($currentParameters.ContainsKey('ClientAppTypes')) + { + $Conditions.Add('ClientAppTypes', $ClientAppTypes) + #no translation or conversion needed } - $Conditions.Add('ClientAppTypes', $ClientAppTypes) - #no translation or conversion needed Write-Verbose -Message 'Set-Targetresource: Adding processed conditions' #add all conditions to the parameter list $NewParameters.Add('Conditions', $Conditions) @@ -1636,19 +1616,32 @@ function Set-TargetResource Write-Verbose -Message "Set-Targetresource: create policy $DisplayName" Write-Verbose -Message 'Create Parameters:' Write-Verbose -Message (Convert-M365DscHashtableToString $NewParameters) - try + + if ($newparameters.Conditions.applications.count -gt 0 -and $newparameters.Conditions.Users.count -gt 0 -and ($newparameters.GrantControls.count -gt 0 -or $newparameters.SessionControls.count -gt 0)) { - New-MgBetaIdentityConditionalAccessPolicy @NewParameters + try + { + New-MgBetaIdentityConditionalAccessPolicy @NewParameters + } + catch + { + New-M365DSCLogEntry -Message 'Error creating new policy:' ` + -Exception $_ ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential + + Write-Verbose -Message 'Set-Targetresource: Failed creating new policy' + } } - catch + else { - New-M365DSCLogEntry -Message 'Error updating data:' ` - -Exception $_ ` - -Source $($MyInvocation.MyCommand.Source) ` - -TenantId $TenantId ` - -Credential $Credential + New-M365DSCLogEntry -Message 'Error creating new policy:' ` + -Source $($MyInvocation.MyCommand.Source) ` + -TenantId $TenantId ` + -Credential $Credential - Write-Verbose -Message 'Set-Targetresource: Failed creating policy' + Write-Verbose -Message 'Set-Targetresource: Failed creating new policy. At least a user rule, application rule and grant or session control is required' } } elseif ($Ensure -eq 'Absent' -and $currentPolicy.Ensure -eq 'Present') diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADConditionalAccessPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADConditionalAccessPolicy.Tests.ps1 index 22aa9e4086..8d87fc35f5 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADConditionalAccessPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.AADConditionalAccessPolicy.Tests.ps1 @@ -296,6 +296,124 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } } + Context -Name 'Policy exists but is not in the Desired State. Not all params specified' -Fixture { + BeforeAll { + $testParams = @{ + DisplayName = 'Allin' + Ensure = 'Present' + Credential = $Credscredential + State = 'disabled' + } + + Mock -CommandName Get-MgBetaPolicyAuthenticationStrengthPolicy -MockWith { + return @{ + Id = "00000000-0000-0000-0000-000000000004" + DisplayName = "Phishing-resistant MFA" + } + } + + Mock -CommandName Get-MgBetaIdentityConditionalAccessPolicy -MockWith { + return @{ + Id = 'bcc0cf19-ee89-46f0-8e12-4b89123ee6f9' + DisplayName = 'Allin' + State = 'enabled' + Conditions = @{ + Applications = @{ + IncludeApplications = @('All') + ExcludeApplications = @('00000012-0000-0000-c000-000000000000', 'Office365') + IncludeUserActions = @('urn:user:registersecurityinfo') + } + Users = @{ + IncludeUsers = 'All' + ExcludeUsers = '76d3c3f6-8269-462b-9385-37435cb33f1e' + IncludeGroups = @('f1eb1a09-c0c2-4df4-9e69-fee01f00db31') + ExcludeGroups = @('f1eb1a09-c0c2-4df4-9e69-fee01f00db31') + IncludeRoles = @('17315797-102d-40b4-93e0-432062caca18') + ExcludeRoles = @('17315797-102d-40b4-93e0-432062caca18') + } + Platforms = @{ + IncludePlatforms = @('Android', 'IOS') + ExcludePlatforms = @('Windows', 'WindowsPhone', 'MacOS') + } + Locations = @{ + IncludeLocations = 'AllTrusted' + ExcludeLocations = '9e4ca5f3-0ba9-4257-b906-74d3038ac970' + } + Devices = @{ + IncludeDevices = @('All') + ExcludeDevices = @('Compliant', 'DomainJoined') + } + ClientAppTypes = @('Browser', 'MobileAppsAndDesktopClients') + SignInRiskLevels = @('High') + UserRiskLevels = @('High') + } + GrantControls = @{ + _Operator = 'AND' + BuiltInControls = @('Mfa', 'CompliantDevice', 'DomainJoinedDevice', 'ApprovedApplication', 'CompliantApplication') + AuthenticationStrength = @{ + Id = "00000000-0000-0000-0000-000000000004" + } + } + SessionControls = @{ + ApplicationEnforcedRestrictions = @{ + IsEnabled = $True + } + CloudAppSecurity = @{ + IsEnabled = $True + CloudAppSecurityType = 'MonitorOnly' + } + SignInFrequency = @{ + IsEnabled = $True + Type = 'Days' + Value = 5 + } + PersistentBrowser = @{ + IsEnabled = $True + Mode = 'Always' + } + } + } + } + Mock -CommandName Get-MgUser -MockWith { + return @{ + Id = '76d3c3f6-8269-462b-9385-37435cb33f1e' + UserPrincipalName = 'alexw@contoso.com' + } + } + Mock -CommandName Get-MgGroup -MockWith { + return @{ + Id = 'f1eb1a09-c0c2-4df4-9e69-fee01f00db31' + DisplayName = 'Group 01' + } + } + Mock -CommandName Get-MgBetaDirectoryRoleTemplate -MockWith { + return @{ + Id = '17315797-102d-40b4-93e0-432062caca18' + DisplayName = 'Compliance Administrator' + } + } + Mock -CommandName Get-MgBetaIdentityConditionalAccessNamedLocation -MockWith { + return @{ + Id = '9e4ca5f3-0ba9-4257-b906-74d3038ac970' + DisplayName = 'Contoso LAN' + } + } + } + + It 'Should return Present from the Get method' { + (Get-TargetResource @testParams).Ensure | Should -Be 'Present' + } + + It 'Should return false from the Test method' { + Test-TargetResource @testParams | Should -Be $false + } + + It 'Should update the settings from the Set method' { + Set-TargetResource @testParams + Should -Invoke -CommandName Update-MgBetaIdentityConditionalAccessPolicy -Exactly 1 + } + } + Context -Name 'Policy exists and is already in the Desired State' -Fixture { BeforeAll { $testParams = @{ From 1f66f63be3c15cfe73677add0c7258a7cf8f3d5d Mon Sep 17 00:00:00 2001 From: Michael Barmettler <99532854+mibarm@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:09:24 +0100 Subject: [PATCH 048/122] add changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce029d2282..e573868f44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ * Remove the logic path to create a new instance in favor of the update flow. * AADAuthenticationMethodPolicyX509 * Remove the logic path to create a new instance in favor of the update flow. +* AADConditionalAccessPolicy + * Fix issue when not all parameters are specified + FIXES [[#4202](https://github.com/microsoft/Microsoft365DSC/issues/4202)] * AADCrossTenantAccessPolicy * Removed the ability to specify a value of Absent for the Ensure property. * AADCrossTenantAccessPolicyCOnfigurationDefault From d053f335b04aa443ab4fa7b46586538fb4f1c189 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Mon, 22 Jan 2024 11:16:54 -0500 Subject: [PATCH 049/122] Update settings.json --- .../DSCResources/MSFT_AADGroup/settings.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/settings.json b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/settings.json index f446ba749c..3bb5995e76 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/settings.json +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADGroup/settings.json @@ -17,18 +17,12 @@ } ], "update": [ - { - "name": "Group.Read.All" - }, { "name": "Group.ReadWrite.All" }, { "name": "Organization.Read.All" }, - { - "name": "RoleManagement.Read.Directory" - }, { "name": "RoleManagement.ReadWrite.Directory" }, From b02e402f6bd81705c19ea4f6b1cd8cc5f910b286 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Mon, 22 Jan 2024 12:59:23 -0500 Subject: [PATCH 050/122] Added Integration Tests for EXO --- .../workflows/Global - Integration - EXO.yml | 205 ++++++++++++++++++ CHANGELOG.md | 2 + .../Dependencies/Manifest.psd1 | 34 +-- .../Resources/EXOAcceptedDomain/1-Create.ps1 | 26 +++ ...reAcceptedDomain.ps1 => 2-Update copy.ps1} | 8 +- .../Resources/EXOAcceptedDomain/2-Update.ps1 | 26 +++ ...eSyncDeviceAccessRule.ps1 => 1-Create.ps1} | 0 .../2-Update.ps1 | 28 +++ .../3-Remove.ps1 | 28 +++ ...gureAddressBookPolicy.ps1 => 1-Create.ps1} | 0 .../EXOAddressBookPolicy/2-Update.ps1 | 29 +++ .../EXOAddressBookPolicy/3-Remove.ps1 | 25 +++ ...-ConfigureAddressList.ps1 => 1-Create.ps1} | 0 .../Resources/EXOAddressList/2-Update.ps1 | 28 +++ .../Resources/EXOAddressList/3-Remove.ps1 | 24 ++ ...figureAntiPhishPolicy.ps1 => 1-Create.ps1} | 0 .../Resources/EXOAntiPhishPolicy/2-Update.ps1 | 43 ++++ .../Resources/EXOAntiPhishPolicy/3-Remove.ps1 | 43 ++++ ...onfigureAntiPhishRule.ps1 => 1-Create.ps1} | 0 .../Resources/EXOAntiPhishRule/2-Update.ps1 | 34 +++ .../Resources/EXOAntiPhishRule/3-Remove.ps1 | 25 +++ ...plicationAccessPolicy.ps1 => 1-Create.ps1} | 2 +- .../EXOApplicationAccessPolicy/2-Update.ps1 | 29 +++ .../EXOApplicationAccessPolicy/3-Remove.ps1 | 25 +++ ...igureAtpPolicyForO365.ps1 => 2-Update.ps1} | 0 ...eAuthenticationPolicy.ps1 => 1-Create.ps1} | 0 .../EXOAuthenticationPolicy/2-Update.ps1 | 36 +++ .../EXOAuthenticationPolicy/3-Remove.ps1 | 36 +++ .../1-Create.ps1 | 20 ++ ...nAuthenticationPolicy.ps1 => 2-Update.ps1} | 2 +- .../3-Remove.ps1 | 20 ++ ...ilabilityAddressSpace.ps1 => 1-Create.ps1} | 0 .../EXOAvailabilityAddressSpace/2-Update.ps1 | 29 +++ .../EXOAvailabilityAddressSpace/3-Remove.ps1 | 26 +++ ...ureAvailabilityConfig.ps1 => 1-Create.ps1} | 3 +- .../EXOAvailabilityConfig/2-Update.ps1 | 26 +++ .../EXOAvailabilityConfig/3-Remove.ps1 | 26 +++ ...nfigureCASMailboxPlan.ps1 => 1-Create.ps1} | 2 +- .../Resources/EXOCASMailboxPlan/2-Update.ps1 | 28 +++ .../Resources/EXOCASMailboxPlan/3-Remove.ps1 | 24 ++ ...ureCASMailboxSettings.ps1 => 1-Create.ps1} | 0 .../EXOCASMailboxSettings/2-Update.ps1 | 52 +++++ .../EXOCASMailboxSettings/3-Remove.ps1 | 26 +++ ...ureCalendarProcessing.ps1 => 1-Create.ps1} | 5 +- .../EXOCalendarProcessing/2-Update.ps1 | 62 ++++++ .../EXOCalendarProcessing/3-Remove.ps1 | 26 +++ ...igureClientAccessRule.ps1 => 1-Create.ps1} | 0 .../EXOClientAccessRule/2-Update.ps1 | 36 +++ .../EXOClientAccessRule/3-Remove.ps1 | 25 +++ ...ureDataClassification.ps1 => 1-Create.ps1} | 0 .../EXODataClassification/2-Update.ps1 | 28 +++ .../EXODataClassification/3-Remove.ps1 | 28 +++ ...eDataEncryptionPolicy.ps1 => 1-Create.ps1} | 0 .../EXODataEncryptionPolicy/2-Update.ps1 | 27 +++ .../EXODataEncryptionPolicy/3-Remove.ps1 | 24 ++ ...eNewDistributionGroup.ps1 => 1-Create.ps1} | 9 +- .../EXODistributionGroup/2-Update.ps1 | 41 ++++ .../EXODistributionGroup/3-Remove.ps1 | 28 +++ ...gureDkimSigningConfig.ps1 => 1-Create.ps1} | 0 .../EXODkimSigningConfig/2-Update.ps1 | 29 +++ .../EXODkimSigningConfig/3-Remove.ps1 | 24 ++ ...ureEmailAddressPolicy.ps1 => 1-Create.ps1} | 9 +- .../EXOEmailAddressPolicy/2-Update.ps1 | 29 +++ .../EXOEmailAddressPolicy/3-Remove.ps1 | 25 +++ ...gureGlobalAddressList.ps1 => 1-Create.ps1} | 0 .../EXOGlobalAddressList/2-Update.ps1 | 28 +++ .../EXOGlobalAddressList/3-Remove.ps1 | 25 +++ ...onfigureGroupSettings.ps1 => 2-Update.ps1} | 5 +- ...onnectionFilterPolicy.ps1 => 1-Create.ps1} | 2 +- .../2-Update.ps1 | 29 +++ .../3-Remove.ps1 | 24 ++ ...edContentFilterPolicy.ps1 => 1-Create.ps1} | 2 +- .../EXOHostedContentFilterPolicy/2-Update.ps1 | 66 ++++++ .../EXOHostedContentFilterPolicy/3-Remove.ps1 | 24 ++ ...stedContentFilterRule.ps1 => 1-Create.ps1} | 2 +- .../EXOHostedContentFilterRule/2-Update.ps1 | 29 +++ .../EXOHostedContentFilterRule/3-Remove.ps1 | 26 +++ ...boundSpamFilterPolicy.ps1 => 1-Create.ps1} | 2 +- .../2-Update.ps1 | 34 +++ .../3-Remove.ps1 | 24 ++ ...utboundSpamFilterRule.ps1 => 1-Create.ps1} | 4 +- .../2-Update.ps1 | 29 +++ .../3-Remove.ps1 | 27 +++ ...igureIRMConfiguration.ps1 => 2-Update.ps1} | 0 ...igureInboundConnector.ps1 => 1-Create.ps1} | 0 .../EXOInboundConnector/2-Update.ps1 | 34 +++ .../EXOInboundConnector/3-Remove.ps1 | 25 +++ ...OrganizationConnector.ps1 => 1-Create.ps1} | 0 .../2-Update.ps1 | 28 +++ .../3-Remove.ps1 | 25 +++ .../{1-CreateJournalRule.ps1 => 1-Create.ps1} | 5 +- .../Resources/EXOJournalRule/2-Update.ps1 | 28 +++ .../Resources/EXOJournalRule/3-Remove.ps1 | 26 +++ .../{1-NewMailContact.ps1 => 1-Create.ps1} | 3 +- .../Resources/EXOMailContact/2-Update.ps1 | 38 ++++ .../Resources/EXOMailContact/3-Remove.ps1 | 33 +++ .../{1-ConfigureMailtips.ps1 => 1-Create.ps1} | 3 +- .../Resources/EXOMailTips/2-Update.ps1 | 30 +++ .../Resources/EXOMailTips/3-Remove.ps1 | 25 +++ ...utoReplyConfiguration.ps1 => 1-Create.ps1} | 9 +- .../2-Update.ps1 | 29 +++ .../3-Remove.ps1 | 25 +++ ...nfigureCalendarFolder.ps1 => 1-Create.ps1} | 2 +- .../EXOMailboxCalendarFolder/2-Update.ps1 | 30 +++ .../EXOMailboxCalendarFolder/3-Remove.ps1 | 25 +++ ...gureMailboxPermission.ps1 => 1-Create.ps1} | 2 +- .../EXOMailboxPermission/2-Update.ps1 | 28 +++ .../EXOMailboxPermission/3-Remove.ps1 | 28 +++ ...-ConfigureMailboxPlan.ps1 => 1-Create.ps1} | 2 +- .../Resources/EXOMailboxPlan/2-Update.ps1 | 31 +++ .../Resources/EXOMailboxPlan/3-Remove.ps1 | 24 ++ ...figureMailboxSettings.ps1 => 1-Create.ps1} | 0 .../Resources/EXOMailboxSettings/2-Update.ps1 | 28 +++ .../Resources/EXOMailboxSettings/3-Remove.ps1 | 26 +++ ...reMalwareFilterPolicy.ps1 => 1-Create.ps1} | 2 +- .../EXOMalwareFilterPolicy/2-Update.ps1 | 32 +++ .../EXOMalwareFilterPolicy/3-Remove.ps1 | 24 ++ ...gureMalwareFilterRule.ps1 => 1-Create.ps1} | 2 +- .../EXOMalwareFilterRule/2-Update.ps1 | 29 +++ .../EXOMalwareFilterRule/3-Remove.ps1 | 26 +++ ...nfigureManagementRole.ps1 => 1-Create.ps1} | 0 .../Resources/EXOManagementRole/2-Update.ps1 | 26 +++ .../Resources/EXOManagementRole/3-Remove.ps1 | 26 +++ ...agementRoleAssignment.ps1 => 1-Create.ps1} | 2 +- .../EXOManagementRoleAssignment/2-Update.ps1 | 26 +++ .../EXOManagementRoleAssignment/3-Remove.ps1 | 26 +++ ...MessageClassification.ps1 => 1-Create.ps1} | 0 .../EXOMessageClassification/2-Update.ps1 | 32 +++ .../EXOMessageClassification/3-Remove.ps1 | 27 +++ ...leDeviceMailboxPolicy.ps1 => 1-Create.ps1} | 0 .../EXOMobileDeviceMailboxPolicy/2-Update.ps1 | 77 +++++++ .../EXOMobileDeviceMailboxPolicy/3-Remove.ps1 | 24 ++ ...igureOMEConfiguration.ps1 => 1-Create.ps1} | 0 .../EXOOMEConfiguration/2-Update.ps1 | 33 +++ .../EXOOMEConfiguration/3-Remove.ps1 | 25 +++ ...EXOOfflineAddressBook.ps1 => 1-Create.ps1} | 2 +- .../EXOOfflineAddressBook/2-Update.ps1 | 30 +++ .../EXOOfflineAddressBook/3-Remove.ps1 | 30 +++ ...nPremisesOrganization.ps1 => 1-Create.ps1} | 0 .../EXOOnPremisesOrganization/2-Update.ps1 | 32 +++ .../EXOOnPremisesOrganization/3-Remove.ps1 | 25 +++ ...eOrganizationSettings.ps1 => 2-Update.ps1} | 0 ...anizationRelationship.ps1 => 1-Create.ps1} | 0 .../EXOOrganizationRelationship/2-Update.ps1 | 37 ++++ .../EXOOrganizationRelationship/3-Remove.ps1 | 26 +++ ...gureOutboundConnector.ps1 => 1-Create.ps1} | 0 .../EXOOutboundConnector/2-Update.ps1 | 37 ++++ .../EXOOutboundConnector/3-Remove.ps1 | 25 +++ ...igureOwaMailboxPolicy.ps1 => 1-Create.ps1} | 2 +- .../EXOOwaMailboxPolicy/2-Update.ps1 | 96 ++++++++ .../EXOOwaMailboxPolicy/3-Remove.ps1 | 24 ++ ...urePartnerApplication.ps1 => 1-Create.ps1} | 0 .../EXOPartnerApplication/2-Update.ps1 | 28 +++ .../EXOPartnerApplication/3-Remove.ps1 | 26 +++ ...erimeterConfiguration.ps1 => 2-Update.ps1} | 0 .../{1-ConfigurePlace.ps1 => 1-Create.ps1} | 5 +- .../Examples/Resources/EXOPlace/2-Update.ps1 | 37 ++++ .../Examples/Resources/EXOPlace/3-Remove.ps1 | 29 +++ ...figurePolicyTipConfig.ps1 => 1-Create.ps1} | 0 .../Resources/EXOPolicyTipConfig/2-Update.ps1 | 26 +++ .../Resources/EXOPolicyTipConfig/3-Remove.ps1 | 26 +++ ...igureQuarantinePolicy.ps1 => 1-Create.ps1} | 3 +- .../EXOQuarantinePolicy/2-Update.ps1 | 28 +++ .../EXOQuarantinePolicy/3-Remove.ps1 | 26 +++ ...ConfigureRemoteDomain.ps1 => 1-Create.ps1} | 2 +- .../Resources/EXORemoteDomain/2-Update.ps1 | 43 ++++ .../Resources/EXORemoteDomain/3-Remove.ps1 | 24 ++ ...eportSubmissionPolicy.ps1 => 2-Update.ps1} | 0 ...eReportSubmissionRule.ps1 => 2-Update.ps1} | 0 ...ResourceConfiguration.ps1 => 2-Update.ps1} | 0 ...eRoleAssignmentPolicy.ps1 => 1-Create.ps1} | 2 +- .../EXORoleAssignmentPolicy/2-Update.ps1 | 27 +++ .../EXORoleAssignmentPolicy/3-Remove.ps1 | 26 +++ ...{1-ConfigureRoleGroup.ps1 => 1-Create.ps1} | 0 .../Resources/EXORoleGroup/2-Update.ps1 | 28 +++ .../Resources/EXORoleGroup/3-Remove.ps1 | 27 +++ ...eSafeAttachmentPolicy.ps1 => 1-Create.ps1} | 3 +- .../EXOSafeAttachmentPolicy/2-Update.ps1 | 29 +++ .../EXOSafeAttachmentPolicy/3-Remove.ps1 | 27 +++ ...ureSafeAttachmentRule.ps1 => 1-Create.ps1} | 2 +- .../EXOSafeAttachmentRule/2-Update.ps1 | 30 +++ .../EXOSafeAttachmentRule/3-Remove.ps1 | 29 +++ ...figureSafeLinksPolicy.ps1 => 1-Create.ps1} | 0 .../Resources/EXOSafeLinksPolicy/2-Update.ps1 | 32 +++ .../Resources/EXOSafeLinksPolicy/3-Remove.ps1 | 25 +++ ...onfigureSafeLinksRule.ps1 => 1-Create.ps1} | 2 +- .../Resources/EXOSafeLinksRule/2-Update.ps1 | 30 +++ .../Resources/EXOSafeLinksRule/3-Remove.ps1 | 28 +++ ...- CreateSharedMailbox.ps1 => 1-Create.ps1} | 5 +- .../Resources/EXOSharedMailbox/2-Update.ps1 | 27 +++ .../Resources/EXOSharedMailbox/3-Remove.ps1 | 27 +++ ...onfigureSharingPolicy.ps1 => 1-Create.ps1} | 2 +- .../Resources/EXOSharingPolicy/2-Update.ps1 | 27 +++ .../Resources/EXOSharingPolicy/3-Remove.ps1 | 27 +++ ...gureTransportSettings.ps1 => 2-Update.ps1} | 0 ...onfigureTransportRule.ps1 => 1-Create.ps1} | 0 .../Resources/EXOTransportRule/2-Update.ps1 | 31 +++ .../Resources/EXOTransportRule/3-Remove.ps1 | 26 +++ 198 files changed, 4006 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/Global - Integration - EXO.yml create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/{1-ConfigureAcceptedDomain.ps1 => 2-Update copy.ps1} (72%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/{1-ConfigureActiveSyncDeviceAccessRule.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/{1-ConfigureAddressBookPolicy.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/{1-ConfigureAddressList.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/{1-ConfigureAntiPhishPolicy.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/{1-ConfigureAntiPhishRule.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/{1-ConfigureApplicationAccessPolicy.ps1 => 1-Create.ps1} (86%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/{1-ConfigureAtpPolicyForO365.ps1 => 2-Update.ps1} (100%) rename Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/{1-ConfigureAuthenticationPolicy.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/3-Remove.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/{1-AssignAuthenticationPolicy.ps1 => 2-Update.ps1} (89%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/{1-ConfigureAvailabilityAddressSpace.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/{1-ConfigureAvailabilityConfig.ps1 => 1-Create.ps1} (83%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/{1-ConfigureCASMailboxPlan.ps1 => 1-Create.ps1} (92%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/{1-ConfigureCASMailboxSettings.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/{1-ConfigureCalendarProcessing.ps1 => 1-Create.ps1} (93%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/{1-ConfigureClientAccessRule.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/{1-ConfigureDataClassification.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/{1-ConfigureDataEncryptionPolicy.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/{1-CreateNewDistributionGroup.ps1 => 1-Create.ps1} (79%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/{1-ConfigureDkimSigningConfig.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/{1-ConfigureEmailAddressPolicy.ps1 => 1-Create.ps1} (67%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/{1-ConfigureGlobalAddressList.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/{1-ConfigureGroupSettings.ps1 => 2-Update.ps1} (91%) rename Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/{1-ConfigureHostedConnectionFilterPolicy.ps1 => 1-Create.ps1} (93%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/{1-ConfigureHostedContentFilterPolicy.ps1 => 1-Create.ps1} (97%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/{1-ConfigureHostedContentFilterRule.ps1 => 1-Create.ps1} (93%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/{1-ConfigureHostedOutboundSpamFilterPolicy.ps1 => 1-Create.ps1} (94%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/{1-ConfigureHostedOutboundSpamFilterRule.ps1 => 1-Create.ps1} (86%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/{1-ConfigureIRMConfiguration.ps1 => 2-Update.ps1} (100%) rename Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/{1-ConfigureInboundConnector.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/{1-ConfigureIntraOrganizationConnector.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/{1-CreateJournalRule.ps1 => 1-Create.ps1} (79%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/{1-NewMailContact.ps1 => 1-Create.ps1} (92%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/{1-ConfigureMailtips.ps1 => 1-Create.ps1} (88%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/{1-ConfigureMailboxAutoReplyConfiguration.ps1 => 1-Create.ps1} (67%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/{1-ConfigureCalendarFolder.ps1 => 1-Create.ps1} (93%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/{1-ConfigureMailboxPermission.ps1 => 1-Create.ps1} (93%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/{1-ConfigureMailboxPlan.ps1 => 1-Create.ps1} (93%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/{1-ConfigureMailboxSettings.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/{1-ConfigureMalwareFilterPolicy.ps1 => 1-Create.ps1} (94%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/{1-ConfigureMalwareFilterRule.ps1 => 1-Create.ps1} (91%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/{1-ConfigureManagementRole.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/{1-NewManagementRoleAssignment.ps1 => 1-Create.ps1} (93%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/{1-ConfigureMessageClassification.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/{1-ConfigureMobileDeviceMailboxPolicy.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/{1-ConfigureOMEConfiguration.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/{1-ConfigureEXOOfflineAddressBook.ps1 => 1-Create.ps1} (97%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/{1-ConfigureOnPremisesOrganization.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/{1-ConfigureOrganizationSettings.ps1 => 2-Update.ps1} (100%) rename Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/{1-ConfigureOrganizationRelationship.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/{1-ConfigureOutboundConnector.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/{1-ConfigureOwaMailboxPolicy.ps1 => 1-Create.ps1} (99%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/{1-ConfigurePartnerApplication.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/{1-ConfigurePerimeterConfiguration.ps1 => 2-Update.ps1} (100%) rename Modules/Microsoft365DSC/Examples/Resources/EXOPlace/{1-ConfigurePlace.ps1 => 1-Create.ps1} (85%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/{1-ConfigurePolicyTipConfig.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/{1-ConfigureQuarantinePolicy.ps1 => 1-Create.ps1} (84%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/{1-ConfigureRemoteDomain.ps1 => 1-Create.ps1} (96%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/{1-ConfigureReportSubmissionPolicy.ps1 => 2-Update.ps1} (100%) rename Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/{1-ConfigureReportSubmissionRule.ps1 => 2-Update.ps1} (100%) rename Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/{1-ConfigureResourceConfiguration.ps1 => 2-Update.ps1} (100%) rename Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/{1-ConfigureRoleAssignmentPolicy.ps1 => 1-Create.ps1} (93%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/{1-ConfigureRoleGroup.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/{1-ConfigureSafeAttachmentPolicy.ps1 => 1-Create.ps1} (86%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/{1-ConfigureSafeAttachmentRule.ps1 => 1-Create.ps1} (92%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/{1-ConfigureSafeLinksPolicy.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/{1-ConfigureSafeLinksRule.ps1 => 1-Create.ps1} (93%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/{1 - CreateSharedMailbox.ps1 => 1-Create.ps1} (76%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/{1-ConfigureSharingPolicy.ps1 => 1-Create.ps1} (92%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/3-Remove.ps1 rename Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/{1-ConfigureTransportSettings.ps1 => 2-Update.ps1} (100%) rename Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/{1-ConfigureTransportRule.ps1 => 1-Create.ps1} (100%) create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/2-Update.ps1 create mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/3-Remove.ps1 diff --git a/.github/workflows/Global - Integration - EXO.yml b/.github/workflows/Global - Integration - EXO.yml new file mode 100644 index 0000000000..4957ccddcd --- /dev/null +++ b/.github/workflows/Global - Integration - EXO.yml @@ -0,0 +1,205 @@ +name: Global - Integration - EXO +on: [push] + +jobs: + Integration-Global-EXO: + # The type of runner that the job will run on + runs-on: windows-latest + + # Only when run from the main repo + if: github.repository == 'microsoft/Microsoft365DSC' + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + - name: Install Microsoft365DSC + shell: powershell + run: | + winrm quickconfig -force + $source = "./Modules/Microsoft365DSC/" + $destination = "C:\Program Files\WindowsPowerShell\Modules" + Copy-Item -Path $source -Recurse -Destination $destination -Container -Force + Update-M365DSCDependencies + - name: Configure Environment + shell: powershell + run: | + Set-ExecutionPolicy Unrestricted -Force + Get-ChildItem "C:\Program Files\WindowsPowerShell\Modules" -Recurse | Unblock-File + Set-M365DSCTelemetryOption -Enabled $false + Set-Item -Path WSMan:\localhost\MaxEnvelopeSizekb -Value 99999 + - name: Generate {Create} Integration Tests from Examples + shell: powershell + run: | + Import-Module './Tests/Integration/M365DSCTestEngine.psm1' + New-M365DSCIntegrationTest -Workload EXO -Step '1-Create' + - name: Commit {Create} Integration Tests + shell: powershell + run: | + git config --local user.email "nicharl@microsoft.com" + git config --local user.name "NikCharlebois" + git add D:/a/Microsoft365DSC/Microsoft365DSC/Tests/Integration/* + git pull + git commit -m "Updated {Create} EXO Integration Tests" + git push + $SHA = git rev-parse HEAD + echo "commitid=$SHA" >> $env:GITHUB_OUTPUT + - name: Run {Create} Integration Tests + shell: powershell + env: + INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} + INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} + run: | + $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force + $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) + try + { + & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.EXO.Create.Tests.ps1 -Credential $Credential + } + catch + { + throw $_ + } + + try + { + $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop + } + catch + { + throw $_ + } + + Write-Host "" + + if ($Result.InDesiredState -eq $false) + { + Write-Host -Message "Resources below are not in the Desired State:" + foreach ($Resource in $Result.ResourcesNotInDesiredState) + { + Write-Host $Resource.InstanceName + } + + throw "Could not validate that the Tenant is in the Desired State" + } + else + { + Write-Host "All resources in the Tenant are in the Desired State" + } + - name: Generate {Update} Integration Tests from Examples + shell: powershell + run: | + Import-Module './Tests/Integration/M365DSCTestEngine.psm1' + New-M365DSCIntegrationTest -Workload EXO -Step '2-Update' + - name: Commit {Update} Integration Tests + shell: powershell + run: | + git config --local user.email "nicharl@microsoft.com" + git config --local user.name "NikCharlebois" + git add D:/a/Microsoft365DSC/Microsoft365DSC/Tests/Integration/* + git pull + git commit -m "Updated {Update} EXO Integration Tests" + git push + $SHA = git rev-parse HEAD + echo "commitid=$SHA" >> $env:GITHUB_OUTPUT + - name: Run {Update} Integration Tests + shell: powershell + env: + INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} + INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} + run: | + $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force + $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) + try + { + & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.EXO.Update.Tests.ps1 -Credential $Credential + } + catch + { + throw $_ + } + + try + { + $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop + } + catch + { + throw $_ + } + + Write-Host "" + + if ($Result.InDesiredState -eq $false) + { + Write-Host -Message "Resources below are not in the Desired State:" + foreach ($Resource in $Result.ResourcesNotInDesiredState) + { + Write-Host $Resource.InstanceName + } + + throw "Could not validate that the Tenant is in the Desired State" + } + else + { + Write-Host "All resources in the Tenant are in the Desired State" + } + - name: Generate {Remove} Integration Tests from Examples + shell: powershell + run: | + Import-Module './Tests/Integration/M365DSCTestEngine.psm1' + New-M365DSCIntegrationTest -Workload EXO -Step '3-Remove' + - name: Commit {Remove} Integration Tests + shell: powershell + run: | + git config --local user.email "nicharl@microsoft.com" + git config --local user.name "NikCharlebois" + git add D:/a/Microsoft365DSC/Microsoft365DSC/Tests/Integration/* + git pull + git commit -m "Updated {Update} EXO Integration Tests" + git push + $SHA = git rev-parse HEAD + echo "commitid=$SHA" >> $env:GITHUB_OUTPUT + - name: Run {Remove} Integration Tests + shell: powershell + env: + INTEGRATION_USERNAME: ${{ secrets.INTEGRATION_USERNAME }} + INTEGRATION_PASSWORD: ${{ secrets.INTEGRATION_PASSWORD }} + run: | + $CredPassword = ConvertTo-SecureString $env:INTEGRATION_PASSWORD -AsPlainText -Force + $Credential = New-Object System.Management.Automation.PSCredential ($env:INTEGRATION_USERNAME, $CredPassword) + try + { + & .\Tests\Integration\Microsoft365DSC\M365DSCIntegration.EXO.Remove.Tests.ps1 -Credential $Credential + } + catch + { + throw $_ + } + + try + { + $Result = Test-DSCConfiguration -Detailed -Verbose -ErrorAction Stop + } + catch + { + throw $_ + } + + Write-Host "" + + if ($Result.InDesiredState -eq $false) + { + Write-Host -Message "Resources below are not in the Desired State:" + foreach ($Resource in $Result.ResourcesNotInDesiredState) + { + Write-Host $Resource.InstanceName + } + + throw "Could not validate that the Tenant is in the Desired State" + } + else + { + Write-Host "All resources in the Tenant are in the Desired State" + } + diff --git a/CHANGELOG.md b/CHANGELOG.md index e573868f44..920fb6117b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. +* DEPENDENCIES + * Updated Microsoft.Graph dependencies to version 2.12.0. # 1.24.117.1 diff --git a/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 b/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 index 7da937491b..92ac5bc2ff 100644 --- a/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 +++ b/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 @@ -10,71 +10,71 @@ }, @{ ModuleName = 'Microsoft.Graph.Applications' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Authentication' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.DeviceManagement' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Devices.CorporateManagement' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.DeviceManagement.Administration' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.DeviceManagement.Enrollment' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Identity.DirectoryManagement' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Identity.Governance' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Identity.SignIns' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Reports' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.Teams' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.DeviceManagement.Administration' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Beta.DirectoryObjects' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Groups' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Planner' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Users' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.Graph.Users.Actions' - RequiredVersion = '2.11.1' + RequiredVersion = '2.12.0' }, @{ ModuleName = 'Microsoft.PowerApps.Administration.PowerShell' diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 new file mode 100644 index 0000000000..5ffbc721c7 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAcceptedDomain 'O365DSCDomain' + { + Identity = 'contoso.com' + DomainType = "Authoritative" + OutboundOnly = $false + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-ConfigureAcceptedDomain.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update copy.ps1 similarity index 72% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-ConfigureAcceptedDomain.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update copy.ps1 index 6e4c8efad3..302a9945f2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-ConfigureAcceptedDomain.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update copy.ps1 @@ -16,10 +16,10 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'contoso.com' - DomainType = "Authoritative" - Ensure = "Present" - Credential = $Credscredential + Identity = 'contoso.com' + DomainType = "Authoritative" + Ensure = "Absent" + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 new file mode 100644 index 0000000000..e5d456d7a5 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAcceptedDomain 'O365DSCDomain' + { + Identity = 'contoso.com' + DomainType = "Authoritative" + OutboundOnly = $true # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-ConfigureActiveSyncDeviceAccessRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-ConfigureActiveSyncDeviceAccessRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/2-Update.ps1 new file mode 100644 index 0000000000..662f870958 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' + { + Identity = "ContosoPhone(DeviceOS)" + Characteristic = "DeviceModel" # Updated Property + QueryString = "iOS 6.1 10B145" + AccessLevel = "Allow" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/3-Remove.ps1 new file mode 100644 index 0000000000..662f870958 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/3-Remove.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' + { + Identity = "ContosoPhone(DeviceOS)" + Characteristic = "DeviceModel" # Updated Property + QueryString = "iOS 6.1 10B145" + AccessLevel = "Allow" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-ConfigureAddressBookPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-ConfigureAddressBookPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 new file mode 100644 index 0000000000..f32e04fcbe --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressBookPolicy 'ConfigureAddressBookPolicy' + { + Name = "All Fabrikam ABP" + AddressLists = "\All Fabrikam","\All Fabrikam Mailboxes","\All Fabrikam Contacts" # Updated Property + RoomList = "\All Fabrikam-Rooms" + OfflineAddressBook = "\Fabrikam-All-OAB" + GlobalAddressList = "\All Fabrikam" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..abac6145f0 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressBookPolicy 'ConfigureAddressBookPolicy' + { + Name = "All Fabrikam ABP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-ConfigureAddressList.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-ConfigureAddressList.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/2-Update.ps1 new file mode 100644 index 0000000000..7c3a151850 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressList 'HRUsersAddressList' + { + Name = "HR Users" + ConditionalCompany = "Contoso" + ConditionalDepartment = "HR2" # Updated Property + ConditionalStateOrProvince = "US" + IncludedRecipients = "AllRecipients" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/3-Remove.ps1 new file mode 100644 index 0000000000..f8e758938b --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressList/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressList 'HRUsersAddressList' + { + Name = "HR Users" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-ConfigureAntiPhishPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-ConfigureAntiPhishPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/2-Update.ps1 new file mode 100644 index 0000000000..7c335a878f --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/2-Update.ps1 @@ -0,0 +1,43 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' + { + Identity = "Our Rule" + MakeDefault = $null + PhishThresholdLevel = 2 # Updated Property + EnableTargetedDomainsProtection = $null + Enabled = $null + TargetedDomainsToProtect = $null + EnableSimilarUsersSafetyTips = $null + ExcludedDomains = $null + TargetedDomainActionRecipients = $null + EnableMailboxIntelligence = $null + EnableSimilarDomainsSafetyTips = $null + AdminDisplayName = "" + AuthenticationFailAction = "MoveToJmf" + TargetedUserProtectionAction = "NoAction" + TargetedUsersToProtect = $null + EnableTargetedUserProtection = $null + ExcludedSenders = $null + EnableOrganizationDomainsProtection = $null + EnableUnusualCharactersSafetyTips = $null + TargetedUserActionRecipients = $null + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..7c335a878f --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishPolicy/3-Remove.ps1 @@ -0,0 +1,43 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' + { + Identity = "Our Rule" + MakeDefault = $null + PhishThresholdLevel = 2 # Updated Property + EnableTargetedDomainsProtection = $null + Enabled = $null + TargetedDomainsToProtect = $null + EnableSimilarUsersSafetyTips = $null + ExcludedDomains = $null + TargetedDomainActionRecipients = $null + EnableMailboxIntelligence = $null + EnableSimilarDomainsSafetyTips = $null + AdminDisplayName = "" + AuthenticationFailAction = "MoveToJmf" + TargetedUserProtectionAction = "NoAction" + TargetedUsersToProtect = $null + EnableTargetedUserProtection = $null + ExcludedSenders = $null + EnableOrganizationDomainsProtection = $null + EnableUnusualCharactersSafetyTips = $null + TargetedUserActionRecipients = $null + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-ConfigureAntiPhishRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-ConfigureAntiPhishRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 new file mode 100644 index 0000000000..04eaa3e3ac --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/2-Update.ps1 @@ -0,0 +1,34 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishRule 'ConfigureAntiPhishRule' + { + Identity = "Test Rule" + ExceptIfSentToMemberOf = $null + ExceptIfSentTo = $null + SentTo = $null + ExceptIfRecipientDomainIs = $null + Comments = $null + AntiPhishPolicy = "Our Rule" + RecipientDomainIs = $null + Enabled = $True + SentToMemberOf = @("msteams_bb15d4@contoso.onmicrosoft.com") + Priority = 2 # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/3-Remove.ps1 new file mode 100644 index 0000000000..24f0dc0aa5 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAntiPhishRule/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishRule 'ConfigureAntiPhishRule' + { + Identity = "Test Rule" + AntiPhishPolicy = "Our Rule" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-ConfigureApplicationAccessPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 similarity index 86% rename from Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-ConfigureApplicationAccessPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 index a89163017b..c88c0ab014 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-ConfigureApplicationAccessPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 @@ -19,7 +19,7 @@ Configuration Example { Identity = "Global" AccessRight = "DenyAccess" - AppID = "3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93" + AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") PolicyScopeGroupId = "Engineering Staff" Description = "Engineering Group Policy" Ensure = "Present" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 new file mode 100644 index 0000000000..54b710aa43 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' + { + Identity = "Global" + AccessRight = "DenyAccess" + AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") + PolicyScopeGroupId = "Engineering Staff" + Description = "Engineering Group Policy Updated" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..de77a3afce --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' + { + Identity = "Global" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/1-ConfigureAtpPolicyForO365.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/1-ConfigureAtpPolicyForO365.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAtpPolicyForO365/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-ConfigureAuthenticationPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-ConfigureAuthenticationPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/2-Update.ps1 new file mode 100644 index 0000000000..c68b7a41be --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/2-Update.ps1 @@ -0,0 +1,36 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' + { + Identity = "Block Basic Auth" + AllowBasicAuthActiveSync = $False + AllowBasicAuthAutodiscover = $False + AllowBasicAuthImap = $False + AllowBasicAuthMapi = $True # Updated Property + AllowBasicAuthOfflineAddressBook = $False + AllowBasicAuthOutlookService = $False + AllowBasicAuthPop = $False + AllowBasicAuthPowerShell = $False + AllowBasicAuthReportingWebServices = $False + AllowBasicAuthRpc = $False + AllowBasicAuthSmtp = $False + AllowBasicAuthWebServices = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..c68b7a41be --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicy/3-Remove.ps1 @@ -0,0 +1,36 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' + { + Identity = "Block Basic Auth" + AllowBasicAuthActiveSync = $False + AllowBasicAuthAutodiscover = $False + AllowBasicAuthImap = $False + AllowBasicAuthMapi = $True # Updated Property + AllowBasicAuthOfflineAddressBook = $False + AllowBasicAuthOutlookService = $False + AllowBasicAuthPop = $False + AllowBasicAuthPowerShell = $False + AllowBasicAuthReportingWebServices = $False + AllowBasicAuthRpc = $False + AllowBasicAuthSmtp = $False + AllowBasicAuthWebServices = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 new file mode 100644 index 0000000000..1970482fa3 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 @@ -0,0 +1,20 @@ +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $EXOAdmin + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' + { + UserName = "AdeleV" + AuthenticationPolicyName = "Block Basic Auth" + Ensure = "Present" + Credential = $EXOAdmin + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-AssignAuthenticationPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 similarity index 89% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-AssignAuthenticationPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 index 0cc2ef79c4..fca14ac182 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-AssignAuthenticationPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 @@ -11,7 +11,7 @@ Configuration Example { EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' { - UserName = "John.Smith" + UserName = "AdeleV" AuthenticationPolicyName = "Test Policy" Ensure = "Present" Credential = $EXOAdmin diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 new file mode 100644 index 0000000000..aa739f5c3e --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 @@ -0,0 +1,20 @@ +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $EXOAdmin + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' + { + UserName = "AdeleV" + AuthenticationPolicyName = "Test Policy" + Ensure = "Absent" + Credential = $EXOAdmin + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-ConfigureAvailabilityAddressSpace.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-ConfigureAvailabilityAddressSpace.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/2-Update.ps1 new file mode 100644 index 0000000000..1dcd3fef7a --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' + { + Identity = 'Contoso.com' + AccessMethod = 'OrgWideFBBasic' # Updated Property + ForestName = 'example.contoso.com' + TargetAutodiscoverEpr = 'https://contoso.com/autodiscover/autodiscover.xml' + Ensure = 'Present' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/3-Remove.ps1 new file mode 100644 index 0000000000..7783b26831 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityAddressSpace/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' + { + Identity = 'Contoso.com' + Ensure = 'Absent' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-ConfigureAvailabilityConfig.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-Create.ps1 similarity index 83% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-ConfigureAvailabilityConfig.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-Create.ps1 index 67e8438f81..7c5ab235ba 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-ConfigureAvailabilityConfig.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/1-Create.ps1 @@ -13,11 +13,12 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "admin@contoso.onmicrosoft.com" + OrgWideAccount = "adelev@$Domain" Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/2-Update.ps1 new file mode 100644 index 0000000000..fb9414d92c --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/2-Update.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAvailabilityConfig 'ConfigureAvailabilityConfig' + { + OrgWideAccount = "alexW@$Domain" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/3-Remove.ps1 new file mode 100644 index 0000000000..395c40d257 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAvailabilityConfig/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAvailabilityConfig 'ConfigureAvailabilityConfig' + { + OrgWideAccount = "alexW@$Domain" # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-ConfigureCASMailboxPlan.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-Create.ps1 similarity index 92% rename from Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-ConfigureCASMailboxPlan.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-Create.ps1 index 6d124c104e..bd698271b2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-ConfigureCASMailboxPlan.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-Create.ps1 @@ -19,7 +19,7 @@ Configuration Example ActiveSyncEnabled = $True OwaMailboxPolicy = "OwaMailboxPolicy-Default" PopEnabled = $True - Identity = $CASIdentity + Identity = 'ExchangeOnlineEnterprise' ImapEnabled = $True Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/2-Update.ps1 new file mode 100644 index 0000000000..349cd529f1 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOCASMailboxPlan 'ConfigureCASMailboxPlan' + { + ActiveSyncEnabled = $True + OwaMailboxPolicy = "OwaMailboxPolicy-Default" + PopEnabled = $False # Updated Property + Identity = 'ExchangeOnlineEnterprise' + ImapEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/3-Remove.ps1 new file mode 100644 index 0000000000..e449bc8191 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOCASMailboxPlan 'ConfigureCASMailboxPlan' + { + Identity = 'ExchangeOnlineEnterprise' + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/1-ConfigureCASMailboxSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/1-ConfigureCASMailboxSettings.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/2-Update.ps1 new file mode 100644 index 0000000000..910c0a15a4 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/2-Update.ps1 @@ -0,0 +1,52 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOCASMailboxSettings 'AdeleVCasMailboxSettings' + { + ActiveSyncAllowedDeviceIDs = @() + ActiveSyncBlockedDeviceIDs = @() + ActiveSyncDebugLogging = $False + ActiveSyncEnabled = $True + ActiveSyncMailboxPolicy = 'Demo EXO Mobile Device Policy Default' + ActiveSyncSuppressReadReceipt = $False + EwsEnabled = $True + Identity = 'AdeleV' + ImapEnabled = $True # Updated Property + ImapForceICalForCalendarRetrievalOption = $False + ImapMessagesRetrievalMimeFormat = 'BestBodyFormat' + ImapSuppressReadReceipt = $False + ImapUseProtocolDefaults = $True + MacOutlookEnabled = $True + MAPIEnabled = $True + OutlookMobileEnabled = $True + OWAEnabled = $True + OWAforDevicesEnabled = $True + OwaMailboxPolicy = 'OwaMailboxPolicy-Default' + PopEnabled = $False + PopForceICalForCalendarRetrievalOption = $True + PopMessagesRetrievalMimeFormat = 'BestBodyFormat' + PopSuppressReadReceipt = $False + PopUseProtocolDefaults = $True + PublicFolderClientAccess = $False + ShowGalAsDefaultView = $True + UniversalOutlookEnabled = $True + Ensure = 'Present' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/3-Remove.ps1 new file mode 100644 index 0000000000..7861342a9a --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOCASMailboxSettings 'AdeleVCasMailboxSettings' + { + Identity = 'AdeleV' + Ensure = 'Absent' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-ConfigureCalendarProcessing.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-ConfigureCalendarProcessing.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-Create.ps1 index 8dd79a6a6e..596a76a67b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-ConfigureCalendarProcessing.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-Create.ps1 @@ -15,6 +15,7 @@ Configuration Example node localhost { + $Domain = $Credscredential.Username.Split('@')[1] EXOCalendarProcessing "CalendarProcessing" { AddAdditionalResponse = $False; @@ -41,7 +42,7 @@ Configuration Example EnforceSchedulingHorizon = $True; Ensure = "Present"; ForwardRequestsToDelegates = $True; - Identity = "John.Smith"; + Identity = "AdeleV"; MaximumConflictInstances = 0; MaximumDurationInMinutes = 1440; MinimumDurationInMinutes = 0; @@ -52,7 +53,7 @@ Configuration Example RemoveForwardedMeetingNotifications = $False; RemoveOldMeetingMessages = $False; RemovePrivateProperty = $True; - RequestInPolicy = @("Bob.Houle@$OrganizationName"); + RequestInPolicy = @("AlexW@$Domain"); ResourceDelegates = @(); ScheduleOnlyDuringWorkHours = $False; TentativePendingApproval = $True; diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 new file mode 100644 index 0000000000..3062e90df0 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/2-Update.ps1 @@ -0,0 +1,62 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXOCalendarProcessing "CalendarProcessing" + { + AddAdditionalResponse = $False; + AddNewRequestsTentatively = $True; + AddOrganizerToSubject = $False; # Updated Property + AllBookInPolicy = $True; + AllowConflicts = $False; + AllowRecurringMeetings = $True; + AllRequestInPolicy = $False; + AllRequestOutOfPolicy = $False; + AutomateProcessing = "AutoUpdate"; + BookingType = "Standard"; + BookingWindowInDays = 180; + BookInPolicy = @(); + ConflictPercentageAllowed = 0; + Credential = $credsCredential; + DeleteAttachments = $True; + DeleteComments = $True; + DeleteNonCalendarItems = $True; + DeleteSubject = $True; + EnableAutoRelease = $False; + EnableResponseDetails = $True; + EnforceCapacity = $False; + EnforceSchedulingHorizon = $True; + Ensure = "Present"; + ForwardRequestsToDelegates = $True; + Identity = "AdeleV"; + MaximumConflictInstances = 0; + MaximumDurationInMinutes = 1440; + MinimumDurationInMinutes = 0; + OrganizerInfo = $True; + PostReservationMaxClaimTimeInMinutes = 10; + ProcessExternalMeetingMessages = $False; + RemoveCanceledMeetings = $False; + RemoveForwardedMeetingNotifications = $False; + RemoveOldMeetingMessages = $False; + RemovePrivateProperty = $True; + RequestInPolicy = @("AlexW@$Domain"); + ResourceDelegates = @(); + ScheduleOnlyDuringWorkHours = $False; + TentativePendingApproval = $True; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/3-Remove.ps1 new file mode 100644 index 0000000000..376ff04c40 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXOCalendarProcessing "CalendarProcessing" + { + Credential = $credsCredential; + Ensure = "Absent"; + Identity = "AdeleV"; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-ConfigureClientAccessRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-ConfigureClientAccessRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 new file mode 100644 index 0000000000..54c4502dde --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 @@ -0,0 +1,36 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOClientAccessRule 'ConfigureClientAccessRule' + { + Action = "AllowAccess" + UserRecipientFilter = $null + ExceptAnyOfAuthenticationTypes = @() + ExceptUsernameMatchesAnyOfPatterns = @() + AnyOfAuthenticationTypes = @() + UsernameMatchesAnyOfPatterns = @() + Identity = "Always Allow Remote PowerShell" + Priority = 1 + AnyOfProtocols = @("RemotePowerShell") + Enabled = $False # Updated Property + ExceptAnyOfProtocols = @() + ExceptAnyOfClientIPAddressesOrRanges = @() + AnyOfClientIPAddressesOrRanges = @() + Ensure = "Present" + Credential = $GlobalAdmin + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 new file mode 100644 index 0000000000..4b4fbfeaf9 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOClientAccessRule 'ConfigureClientAccessRule' + { + Action = "AllowAccess" + Identity = "Always Allow Remote PowerShell" + Ensure = "Absent" + Credential = $GlobalAdmin + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/1-ConfigureDataClassification.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/1-ConfigureDataClassification.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 new file mode 100644 index 0000000000..1f4d62384e --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataClassification 'ConfigureDataClassification' + { + Identity = 'Contoso Confidential' + Name = 'Contoso Confidentiel' + Description = 'Ce message contient des informations confidentielles. Updated' # Updated Property + Locale = 'fr' + IsDefault = $true + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/3-Remove.ps1 new file mode 100644 index 0000000000..1f4d62384e --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/3-Remove.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataClassification 'ConfigureDataClassification' + { + Identity = 'Contoso Confidential' + Name = 'Contoso Confidentiel' + Description = 'Ce message contient des informations confidentielles. Updated' # Updated Property + Locale = 'fr' + IsDefault = $true + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/1-ConfigureDataEncryptionPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/1-ConfigureDataEncryptionPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/2-Update.ps1 new file mode 100644 index 0000000000..b9f21cf1a7 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/2-Update.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' + { + Identity = 'US Mailboxes' + Name = 'All US Mailboxes' + Description = 'All Mailboxes of users in the US. Updated' # Updated Property + Enabled = $true + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..e17823fec1 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODataEncryptionPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' + { + Identity = 'US Mailboxes' + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-CreateNewDistributionGroup.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 similarity index 79% rename from Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-CreateNewDistributionGroup.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 index 0dbf6928a9..94bff7ab26 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-CreateNewDistributionGroup.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 @@ -15,6 +15,7 @@ Configuration Example node localhost { + $Domain = $Credscredential.Username.Split('@')[1] EXODistributionGroup 'DemoDG' { Alias = "demodg"; @@ -23,15 +24,15 @@ Configuration Example DisplayName = "My Demo DG"; Ensure = "Present"; HiddenGroupMembershipEnabled = $True; - ManagedBy = @("john.smith@contoso.com"); + ManagedBy = @("adeleV@$Domain"); MemberDepartRestriction = "Open"; MemberJoinRestriction = "Closed"; - ModeratedBy = @("admin@contoso.com"); + ModeratedBy = @("alexW@$Domain"); ModerationEnabled = $False; Identity = "DemoDG"; Name = "DemoDG"; - OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/contoso.com"; - PrimarySmtpAddress = "demodg@contoso.com"; + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain"; + PrimarySmtpAddress = "demodg@$Domain"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; Credential = $credsAdmin diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 new file mode 100644 index 0000000000..81d407bcc2 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 @@ -0,0 +1,41 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsAdmin + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXODistributionGroup 'DemoDG' + { + Alias = "demodg"; + BccBlocked = $True; # Updated Property + BypassNestedModerationEnabled = $False; + DisplayName = "My Demo DG"; + Ensure = "Present"; + HiddenGroupMembershipEnabled = $True; + ManagedBy = @("adeleV@$Domain"); + MemberDepartRestriction = "Open"; + MemberJoinRestriction = "Closed"; + ModeratedBy = @("alexW@$Domain"); + ModerationEnabled = $False; + Identity = "DemoDG"; + Name = "DemoDG"; + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain"; + PrimarySmtpAddress = "demodg@$Domain"; + RequireSenderAuthenticationEnabled = $True; + SendModerationNotifications = "Always"; + Credential = $credsAdmin + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 new file mode 100644 index 0000000000..47ab50452e --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsAdmin + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXODistributionGroup 'DemoDG' + { + DisplayName = "My Demo DG"; + Ensure = "Absent"; + Identity = "DemoDG"; + Name = "DemoDG"; + Credential = $credsAdmin + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-ConfigureDkimSigningConfig.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-ConfigureDkimSigningConfig.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/2-Update.ps1 new file mode 100644 index 0000000000..f9d8760554 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODkimSigningConfig 'ConfigureDKIMSigning' + { + KeySize = 1024 + Identity = 'contoso.onmicrosoft.com' + HeaderCanonicalization = "Relaxed" + Enabled = $False # Updated Property + BodyCanonicalization = "Relaxed" + AdminDisplayName = "" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/3-Remove.ps1 new file mode 100644 index 0000000000..39c018e8b5 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODkimSigningConfig/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODkimSigningConfig 'ConfigureDKIMSigning' + { + Identity = 'contoso.onmicrosoft.com' + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-ConfigureEmailAddressPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 similarity index 67% rename from Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-ConfigureEmailAddressPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 index 08e1fc7bad..4d15d6d523 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-ConfigureEmailAddressPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 @@ -14,13 +14,14 @@ Configuration Example node localhost { + $Domain = $Credscredential.Username.Split('@')[1] EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { - Name = "Default Policy" - EnabledEmailAddressTemplates = @("SMTP:@contoso.onmicrosoft.com") - EnabledPrimarySMTPAddressTemplate = "@contoso.onmicrosoft.com" + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" ManagedByFilter = "" - Priority = "Lowest" + Priority = 1 Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 new file mode 100644 index 0000000000..4be41679af --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" + ManagedByFilter = "" + Priority = 2 # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..b6d8b3907a --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-ConfigureGlobalAddressList.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-ConfigureGlobalAddressList.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/2-Update.ps1 new file mode 100644 index 0000000000..4e0ecce8c3 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOGlobalAddressList 'ConfigureGlobalAddressList' + { + Name = "Contoso Human Resources in Washington" + ConditionalCompany = "Contoso" + ConditionalDepartment = "Finances" # Updated Property + ConditionalStateOrProvince = "Washington" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/3-Remove.ps1 new file mode 100644 index 0000000000..9ea08ce6cf --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOGlobalAddressList/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOGlobalAddressList 'ConfigureGlobalAddressList' + { + Name = "Contoso Human Resources in Washington" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/1-ConfigureGroupSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 similarity index 91% rename from Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/1-ConfigureGroupSettings.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 index a9c7d17766..8892473aa1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/1-ConfigureGroupSettings.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 @@ -16,6 +16,7 @@ Configuration Example node localhost { + $Domain = $Credscredential.Username.Split('@')[1] EXOGroupSettings 'TestGroup' { DisplayName = "Test Group"; @@ -24,7 +25,7 @@ Configuration Example AuditLogAgeLimit = "90.00:00:00"; AutoSubscribeNewMembers = $False; CalendarMemberReadOnly = $False; - ConnectorsEnabled = $True; + ConnectorsEnabled = $False; # Updated Property Credential = $credential; HiddenFromAddressListsEnabled = $True; HiddenFromExchangeClientsEnabled = $True; @@ -34,7 +35,7 @@ Configuration Example MaxSendSize = "35 MB (36,700,160 bytes)"; ModerationEnabled = $False; Notes = "My Notes"; - PrimarySmtpAddress = "TestGroup@contoso.com"; + PrimarySmtpAddress = "TestGroup@$Domain"; RequireSenderAuthenticationEnabled = $True; SubscriptionEnabled = $False; } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-ConfigureHostedConnectionFilterPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-ConfigureHostedConnectionFilterPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-Create.ps1 index 8f22f2840c..dc5cfd26cb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-ConfigureHostedConnectionFilterPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' { - Identity = "Default" + Identity = "Integration Policy" AdminDisplayName = "" EnableSafeList = $False IPAllowList = @() diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/2-Update.ps1 new file mode 100644 index 0000000000..5f06631889 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' + { + Identity = "Integration Policy" + AdminDisplayName = "" + EnableSafeList = $True # Updated Property + IPAllowList = @() + IPBlockList = @() + MakeDefault = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..dcba8d2b18 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedConnectionFilterPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' + { + Identity = "Integration Policy" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-ConfigureHostedContentFilterPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-Create.ps1 similarity index 97% rename from Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-ConfigureHostedContentFilterPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-Create.ps1 index 994279d2bd..8ad924b9f0 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-ConfigureHostedContentFilterPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' { - Identity = "Default" + Identity = "Integration CFP" AddXHeaderValue = "" AdminDisplayName = "" BulkSpamAction = "MoveToJmf" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/2-Update.ps1 new file mode 100644 index 0000000000..68f54d10fd --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/2-Update.ps1 @@ -0,0 +1,66 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' + { + Identity = "Integration CFP" + AddXHeaderValue = "" + AdminDisplayName = "" + BulkSpamAction = "MoveToJmf" + BulkThreshold = 7 + DownloadLink = $True # Updated Property + EnableEndUserSpamNotifications = $False + EnableLanguageBlockList = $False + EnableRegionBlockList = $False + EndUserSpamNotificationCustomSubject = "" + EndUserSpamNotificationFrequency = 3 + EndUserSpamNotificationLanguage = "Default" + HighConfidencePhishAction = "Quarantine" + HighConfidenceSpamAction = "MoveToJmf" + IncreaseScoreWithBizOrInfoUrls = "Off" + IncreaseScoreWithImageLinks = "Off" + IncreaseScoreWithNumericIps = "Off" + IncreaseScoreWithRedirectToOtherPort = "Off" + InlineSafetyTipsEnabled = $True + LanguageBlockList = @() + MakeDefault = $True + MarkAsSpamBulkMail = "On" + MarkAsSpamEmbedTagsInHtml = "Off" + MarkAsSpamEmptyMessages = "Off" + MarkAsSpamFormTagsInHtml = "Off" + MarkAsSpamFramesInHtml = "Off" + MarkAsSpamFromAddressAuthFail = "Off" + MarkAsSpamJavaScriptInHtml = "Off" + MarkAsSpamNdrBackscatter = "Off" + MarkAsSpamObjectTagsInHtml = "Off" + MarkAsSpamSensitiveWordList = "Off" + MarkAsSpamSpfRecordHardFail = "Off" + MarkAsSpamWebBugsInHtml = "Off" + ModifySubjectValue = "" + PhishSpamAction = "MoveToJmf" + PhishZapEnabled = $True + QuarantineRetentionPeriod = 15 + RedirectToRecipients = @() + RegionBlockList = @() + SpamAction = "MoveToJmf" + SpamZapEnabled = $True + TestModeAction = "None" + TestModeBccToRecipients = @() + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..3a7d7dd917 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' + { + Identity = "Integration CFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-ConfigureHostedContentFilterRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-ConfigureHostedContentFilterRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-Create.ps1 index 6e3d3da7a5..304e2d1e99 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-ConfigureHostedContentFilterRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/1-Create.ps1 @@ -21,7 +21,7 @@ Configuration Example Comments = "Applies to all users, except when member of HR group" Enabled = $True ExceptIfSentToMemberOf = "Contoso Human Resources" - HostedContentFilterPolicy = "Default" + HostedContentFilterPolicy = "Integration CFP" Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/2-Update.ps1 new file mode 100644 index 0000000000..4c0bbf0035 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' + { + Identity = "Contoso Recipients" + Comments = "Applies to all users, except when member of HR group" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Contoso Human Resources" + HostedContentFilterPolicy = "Integration CFP" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/3-Remove.ps1 new file mode 100644 index 0000000000..4af57b4f29 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedContentFilterRule/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' + { + Identity = "Contoso Recipients" + HostedContentFilterPolicy = "Integration CFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-ConfigureHostedOutboundSpamFilterPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-Create.ps1 similarity index 94% rename from Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-ConfigureHostedOutboundSpamFilterPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-Create.ps1 index faabfc4d7c..ea0c0cf6a3 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-ConfigureHostedOutboundSpamFilterPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' { - Identity = "Default" + Identity = "Integration SFP" ActionWhenThresholdReached = "BlockUserForToday" AdminDisplayName = "" AutoForwardingMode = "Automatic" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/2-Update.ps1 new file mode 100644 index 0000000000..d5d9157e3e --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/2-Update.ps1 @@ -0,0 +1,34 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' + { + Identity = "Integration SFP" + ActionWhenThresholdReached = "BlockUserForToday" + AdminDisplayName = "" + AutoForwardingMode = "Automatic" + BccSuspiciousOutboundAdditionalRecipients = @() + BccSuspiciousOutboundMail = $False + NotifyOutboundSpam = $False + NotifyOutboundSpamRecipients = @() + RecipientLimitExternalPerHour = 0 + RecipientLimitInternalPerHour = 1 # Updated Property + RecipientLimitPerDay = 0 + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..891b4a4be9 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' + { + Identity = "Integration SFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-ConfigureHostedOutboundSpamFilterRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-Create.ps1 similarity index 86% rename from Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-ConfigureHostedOutboundSpamFilterRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-Create.ps1 index 336307c6e8..b2680a0974 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-ConfigureHostedOutboundSpamFilterRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/1-Create.ps1 @@ -20,8 +20,8 @@ Configuration Example Identity = "Contoso Executives" Comments = "Does not apply to Executives" Enabled = $True - ExceptIfFrom = "Elizabeth Brunner" - HostedOutboundSpamFilterPolicy = "Default" + ExceptIfFrom = "John Smith" + HostedOutboundSpamFilterPolicy = "Integration SFP" Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/2-Update.ps1 new file mode 100644 index 0000000000..4d7ae70dd0 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' + { + Identity = "Contoso Executives" + Comments = "Does not apply to Executives" + Enabled = $False # Updated Property + ExceptIfFrom = "John Smith" + HostedOutboundSpamFilterPolicy = "Integration SFP" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/3-Remove.ps1 new file mode 100644 index 0000000000..fd568fae34 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOHostedOutboundSpamFilterRule/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' + { + Identity = "Contoso Executives" + Enabled = $False # Updated Property + HostedOutboundSpamFilterPolicy = "Integration SFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/1-ConfigureIRMConfiguration.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/1-ConfigureIRMConfiguration.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOIRMConfiguration/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-ConfigureInboundConnector.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-ConfigureInboundConnector.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/2-Update.ps1 new file mode 100644 index 0000000000..7a38b9078b --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/2-Update.ps1 @@ -0,0 +1,34 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOInboundConnector 'ConfigureInboundConnector' + { + Identity = "Contoso Inbound Connector" + CloudServicesMailEnabled = $True + Comment = "Inbound connector for Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $False # Updated Property + RequireTls = $True + SenderDomains = "*.contoso.com" + TlsSenderCertificateName = "contoso.com" + TreatMessagesAsInternal = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/3-Remove.ps1 new file mode 100644 index 0000000000..974357ff51 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOInboundConnector/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOInboundConnector 'ConfigureInboundConnector' + { + Identity = "Contoso Inbound Connector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-ConfigureIntraOrganizationConnector.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-ConfigureIntraOrganizationConnector.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/2-Update.ps1 new file mode 100644 index 0000000000..34b31fcc80 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' + { + Identity = "MainCloudConnector" + DiscoveryEndpoint = "https://ExternalDiscovery.Contoso.com" + TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" + Enabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/3-Remove.ps1 new file mode 100644 index 0000000000..e5c9f58607 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOIntraOrganizationConnector/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' + { + Identity = "MainCloudConnector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-CreateJournalRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-Create.ps1 similarity index 79% rename from Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-CreateJournalRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-Create.ps1 index 46d4a9ac00..b69332c585 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-CreateJournalRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/1-Create.ps1 @@ -12,13 +12,14 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOJournalRule 'CreateJournalRule' { Enabled = $True - JournalEmailAddress = "John.Smith@contoso.com" - Name = "Send to John" + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" RuleScope = "Global" Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/2-Update.ps1 new file mode 100644 index 0000000000..1161e39a67 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOJournalRule 'CreateJournalRule' + { + Enabled = $False # Updated Property + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" + RuleScope = "Global" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/3-Remove.ps1 new file mode 100644 index 0000000000..fdc5d0c87e --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOJournalRule/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOJournalRule 'CreateJournalRule' + { + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-NewMailContact.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-Create.ps1 similarity index 92% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-NewMailContact.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-Create.ps1 index 74c7a2ac87..a4577146ab 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-NewMailContact.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/1-Create.ps1 @@ -12,6 +12,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailContact 'TestMailContact' @@ -27,7 +28,7 @@ Configuration Example ModeratedBy = @() ModerationEnabled = $false Name = 'My Test Contact' - OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$OrganizationName" + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" SendModerationNotifications = 'Always' UsePreferMessageFormat = $true CustomAttribute1 = 'Custom Value 1' diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/2-Update.ps1 new file mode 100644 index 0000000000..c9b69b8bec --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/2-Update.ps1 @@ -0,0 +1,38 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailContact 'TestMailContact' + { + Alias = 'TestMailContact' + Credential = $Credscredential + DisplayName = 'My Test Contact' + Ensure = 'Present' + ExternalEmailAddress = 'SMTP:test@tailspintoys.com' + MacAttachmentFormat = 'BinHex' + MessageBodyFormat = 'TextAndHtml' + MessageFormat = 'Mime' + ModeratedBy = @() + ModerationEnabled = $false + Name = 'My Test Contact' + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" + SendModerationNotifications = 'Always' + UsePreferMessageFormat = $false # Updated Property + CustomAttribute1 = 'Custom Value 1' + ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/3-Remove.ps1 new file mode 100644 index 0000000000..f84f309064 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailContact/3-Remove.ps1 @@ -0,0 +1,33 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailContact 'TestMailContact' + { + Alias = 'TestMailContact' + Credential = $Credscredential + DisplayName = 'My Test Contact' + Ensure = 'Absent' + ExternalEmailAddress = 'SMTP:test@tailspintoys.com' + Name = 'My Test Contact' + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" + SendModerationNotifications = 'Always' + UsePreferMessageFormat = $false # Updated Property + CustomAttribute1 = 'Custom Value 1' + ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-ConfigureMailtips.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-Create.ps1 similarity index 88% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-ConfigureMailtips.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-Create.ps1 index 25b357232c..3c71726bab 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-ConfigureMailtips.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/1-Create.ps1 @@ -12,11 +12,12 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailTips 'OrgWideMailTips' { - Organization = "contoso.com" + Organization = $Domain MailTipsAllTipsEnabled = $True MailTipsGroupMetricsEnabled = $True MailTipsLargeAudienceThreshold = 100 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/2-Update.ps1 new file mode 100644 index 0000000000..172deb2c04 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/2-Update.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailTips 'OrgWideMailTips' + { + Organization = $Domain + MailTipsAllTipsEnabled = $True + MailTipsGroupMetricsEnabled = $False # Updated Property + MailTipsLargeAudienceThreshold = 100 + MailTipsMailboxSourcedTipsEnabled = $True + MailTipsExternalRecipientsTipsEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/3-Remove.ps1 new file mode 100644 index 0000000000..d4e681aa7d --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailTips/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailTips 'OrgWideMailTips' + { + Organization = $Domain + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-ConfigureMailboxAutoReplyConfiguration.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-Create.ps1 similarity index 67% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-ConfigureMailboxAutoReplyConfiguration.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-Create.ps1 index 08e1fc7bad..5f61c9a780 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-ConfigureMailboxAutoReplyConfiguration.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-Create.ps1 @@ -12,15 +12,16 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { - Name = "Default Policy" - EnabledEmailAddressTemplates = @("SMTP:@contoso.onmicrosoft.com") - EnabledPrimarySMTPAddressTemplate = "@contoso.onmicrosoft.com" + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" ManagedByFilter = "" - Priority = "Lowest" + Priority = 1 Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 new file mode 100644 index 0000000000..59a62ba67e --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" + ManagedByFilter = "" + Priority = 2 # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 new file mode 100644 index 0000000000..2df42cc7a3 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-ConfigureCalendarFolder.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-ConfigureCalendarFolder.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-Create.ps1 index d5256cf626..bf6562a9e7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-ConfigureCalendarFolder.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-Create.ps1 @@ -20,7 +20,7 @@ Configuration Example Credential = $credsCredential; DetailLevel = "AvailabilityOnly"; Ensure = "Present"; - Identity = "john.smith:\Calendar"; + Identity = "AdeleV:\Calendar"; PublishDateRangeFrom = "ThreeMonths"; PublishDateRangeTo = "ThreeMonths"; PublishEnabled = $False; diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/2-Update.ps1 new file mode 100644 index 0000000000..12a8ee1f95 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/2-Update.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMailboxCalendarFolder "JohnCalendarFolder" + { + Credential = $credsCredential; + DetailLevel = "AvailabilityOnly"; + Ensure = "Present"; + Identity = "AdeleV:\Calendar"; + PublishDateRangeFrom = "ThreeMonths"; + PublishDateRangeTo = "ThreeMonths"; + PublishEnabled = $True; # Updated Property + SearchableUrlEnabled = $False; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/3-Remove.ps1 new file mode 100644 index 0000000000..0fe697312e --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMailboxCalendarFolder "JohnCalendarFolder" + { + Credential = $credsCredential; + Ensure = "Absent"; + Identity = "AdeleV:\Calendar"; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-ConfigureMailboxPermission.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-ConfigureMailboxPermission.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-Create.ps1 index d3dd22581f..5df61e351c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-ConfigureMailboxPermission.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-Create.ps1 @@ -20,7 +20,7 @@ Configuration Example Credential = $credsCredential; Deny = $False; Ensure = "Present"; - Identity = "John.Smith"; + Identity = "AdeleV"; InheritanceType = "All"; User = "NT AUTHORITY\SELF"; } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/2-Update.ps1 new file mode 100644 index 0000000000..732a1e769d --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMailboxPermission "TestPermission" + { + AccessRights = @("FullAccess","ReadPermission"); + Credential = $credsCredential; + Deny = $True; # Updated Property + Ensure = "Present"; + Identity = "AdeleV"; + InheritanceType = "All"; + User = "NT AUTHORITY\SELF"; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/3-Remove.ps1 new file mode 100644 index 0000000000..eb3fc87f07 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/3-Remove.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMailboxPermission "TestPermission" + { + AccessRights = @("FullAccess","ReadPermission"); + Credential = $credsCredential; + Deny = $True; # Updated Property + Ensure = "Absent"; + Identity = "AdeleV"; + InheritanceType = "All"; + User = "NT AUTHORITY\SELF"; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-ConfigureMailboxPlan.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-ConfigureMailboxPlan.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-Create.ps1 index 6d01ededb7..52a5907e55 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-ConfigureMailboxPlan.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-Create.ps1 @@ -17,7 +17,7 @@ Configuration Example EXOMailboxPlan 'ConfigureMailboxPlan' { Ensure = "Present"; - Identity = "ExchangeOnlineEnterprise"; + Identity = "Integration Plan"; IssueWarningQuota = "98 GB (105,226,698,752 bytes)"; MaxReceiveSize = "25 MB (26,214,400 bytes)"; MaxSendSize = "25 MB (26,214,400 bytes)"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/2-Update.ps1 new file mode 100644 index 0000000000..998d3222d6 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/2-Update.ps1 @@ -0,0 +1,31 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMailboxPlan 'ConfigureMailboxPlan' + { + Ensure = "Present"; + Identity = "Integration Plan"; + IssueWarningQuota = "98 GB (105,226,698,752 bytes)"; + MaxReceiveSize = "25 MB (26,214,400 bytes)"; + MaxSendSize = "25 MB (26,214,400 bytes)"; + ProhibitSendQuota = "99 GB (106,300,440,576 bytes)"; + ProhibitSendReceiveQuota = "15 GB (16,106,127,360 bytes)"; # Updated Property + RetainDeletedItemsFor = "14.00:00:00"; + RoleAssignmentPolicy = "Default Role Assignment Policy"; + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/3-Remove.ps1 new file mode 100644 index 0000000000..1f0e129ffc --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMailboxPlan 'ConfigureMailboxPlan' + { + Ensure = "Absent"; + Identity = "Integration Plan"; + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/1-ConfigureMailboxSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/1-ConfigureMailboxSettings.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/2-Update.ps1 new file mode 100644 index 0000000000..91d0da31c2 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMailboxSettings 'OttawaTeamMailboxSettings' + { + DisplayName = 'Ottawa Employees' + TimeZone = 'Eastern Standard Time' + Locale = 'en-US' # Updated Property + Ensure = 'Present' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/3-Remove.ps1 new file mode 100644 index 0000000000..9c29e03011 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMailboxSettings 'OttawaTeamMailboxSettings' + { + DisplayName = 'Ottawa Employees' + Ensure = 'Absent' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-ConfigureMalwareFilterPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-Create.ps1 similarity index 94% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-ConfigureMalwareFilterPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-Create.ps1 index aeaed230e3..283795ee7b 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-ConfigureMalwareFilterPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' { - Identity = "Default" + Identity = "IntegrationMFP" CustomNotifications = $False EnableExternalSenderAdminNotifications = $False EnableFileFilter = $False diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/2-Update.ps1 new file mode 100644 index 0000000000..862d17b0bb --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/2-Update.ps1 @@ -0,0 +1,32 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' + { + Identity = "IntegrationMFP" + CustomNotifications = $False + EnableExternalSenderAdminNotifications = $False + EnableFileFilter = $False + EnableInternalSenderAdminNotifications = $False + FileTypeAction = "Quarantine" + FileTypes = @("ace", "ani", "app", "cab", "docm", "exe", "iso", "jar", "jnlp", "reg", "scr", "vbe", "vbs") + QuarantineTag = "AdminOnlyAccessPolicy" + ZapEnabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..22d47da26d --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' + { + Identity = "IntegrationMFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-ConfigureMalwareFilterRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-Create.ps1 similarity index 91% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-ConfigureMalwareFilterRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-Create.ps1 index ee7f700720..91edbc4237 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-ConfigureMalwareFilterRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/1-Create.ps1 @@ -18,7 +18,7 @@ Configuration Example EXOMalwareFilterRule 'ConfigureMalwareFilterRule' { Identity = "Contoso Recipients" - MalwareFilterPolicy = "Contoso Malware Filter Policy" + MalwareFilterPolicy = "IntegrationMFP" Comments = "Apply the filter to all Contoso users" Enabled = $True RecipientDomainIs = "contoso.com" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/2-Update.ps1 new file mode 100644 index 0000000000..e36ce09244 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterRule 'ConfigureMalwareFilterRule' + { + Identity = "Contoso Recipients" + MalwareFilterPolicy = "IntegrationMFP" + Comments = "Apply the filter to all Contoso users" + Enabled = $False # Updated Property + RecipientDomainIs = "contoso.com" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/3-Remove.ps1 new file mode 100644 index 0000000000..f6f2a1a2a4 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMalwareFilterRule/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterRule 'ConfigureMalwareFilterRule' + { + Identity = "Contoso Recipients" + MalwareFilterPolicy = "IntegrationMFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-ConfigureManagementRole.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-ConfigureManagementRole.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/2-Update.ps1 new file mode 100644 index 0000000000..512cd43c77 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/2-Update.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRole 'ConfigureManagementRole' + { + Name = "MyDisplayName" + Description = "Updated Description" # Updated Property + Parent = "contoso.onmicrosoft.com\MyProfileInformation" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/3-Remove.ps1 new file mode 100644 index 0000000000..65e2e25345 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRole/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRole 'ConfigureManagementRole' + { + Name = "MyDisplayName" + Description = "Updated Description" # Updated Property + Parent = "contoso.onmicrosoft.com\MyProfileInformation" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-NewManagementRoleAssignment.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-NewManagementRoleAssignment.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-Create.ps1 index 4ee5ae6f22..aee17ea1b5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-NewManagementRoleAssignment.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/1-Create.ps1 @@ -20,7 +20,7 @@ Configuration Example Ensure = "Present"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "John.Smith"; + User = "AdeleV"; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/2-Update.ps1 new file mode 100644 index 0000000000..76465f6366 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/2-Update.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRoleAssignment 'AssignManagementRole' + { + Credential = $credsCredential; + Ensure = "Present"; + Name = "MyManagementRoleAssignment"; + Role = "UserApplication"; + User = "AlexW"; # Updated Property + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/3-Remove.ps1 new file mode 100644 index 0000000000..27ba43c715 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOManagementRoleAssignment/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRoleAssignment 'AssignManagementRole' + { + Credential = $credsCredential; + Ensure = "Absent"; + Name = "MyManagementRoleAssignment"; + Role = "UserApplication"; + User = "AlexW"; # Updated Property + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-ConfigureMessageClassification.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-ConfigureMessageClassification.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/2-Update.ps1 new file mode 100644 index 0000000000..9054444658 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/2-Update.ps1 @@ -0,0 +1,32 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMessageClassification 'ConfigureMessageClassification' + { + Identity = "Contoso Message Classification" + Name = "Contoso Message Classification" + DisplayName = "Contoso Message Classification" + DisplayPrecedence = "Highest" + PermissionMenuVisible = $True + RecipientDescription = "Shown to receipients" + SenderDescription = "Shown to senders" + RetainClassificationEnabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/3-Remove.ps1 new file mode 100644 index 0000000000..f02998c20b --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMessageClassification/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMessageClassification 'ConfigureMessageClassification' + { + Identity = "Contoso Message Classification" + Name = "Contoso Message Classification" + DisplayName = "Contoso Message Classification" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-ConfigureMobileDeviceMailboxPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-ConfigureMobileDeviceMailboxPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/2-Update.ps1 new file mode 100644 index 0000000000..1c21d6c9cc --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/2-Update.ps1 @@ -0,0 +1,77 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' + { + Name = "Default" + AllowApplePushNotifications = $True + AllowBluetooth = "Allow" + AllowBrowser = $False # Updated Property + AllowCamera = $True + AllowConsumerEmail = $True + AllowDesktopSync = $True + AllowExternalDeviceManagement = $False + AllowGooglePushNotifications = $True + AllowHTMLEmail = $True + AllowInternetSharing = $True + AllowIrDA = $True + AllowMicrosoftPushNotifications = $True + AllowMobileOTAUpdate = $True + AllowNonProvisionableDevices = $True + AllowPOPIMAPEmail = $True + AllowRemoteDesktop = $True + AllowSimplePassword = $True + AllowSMIMEEncryptionAlgorithmNegotiation = "AllowAnyAlgorithmNegotiation" + AllowSMIMESoftCerts = $True + AllowStorageCard = $True + AllowTextMessaging = $True + AllowUnsignedApplications = $True + AllowUnsignedInstallationPackages = $True + AllowWiFi = $True + AlphanumericPasswordRequired = $False + ApprovedApplicationList = @() + AttachmentsEnabled = $True + DeviceEncryptionEnabled = $False + DevicePolicyRefreshInterval = "Unlimited" + IrmEnabled = $True + IsDefault = $True + MaxAttachmentSize = "Unlimited" + MaxCalendarAgeFilter = "All" + MaxEmailAgeFilter = "All" + MaxEmailBodyTruncationSize = "Unlimited" + MaxEmailHTMLBodyTruncationSize = "Unlimited" + MaxInactivityTimeLock = "Unlimited" + MaxPasswordFailedAttempts = "Unlimited" + MinPasswordComplexCharacters = 1 + PasswordEnabled = $False + PasswordExpiration = "Unlimited" + PasswordHistory = 0 + PasswordRecoveryEnabled = $False + RequireDeviceEncryption = $False + RequireEncryptedSMIMEMessages = $False + RequireEncryptionSMIMEAlgorithm = "TripleDES" + RequireManualSyncWhenRoaming = $False + RequireSignedSMIMEAlgorithm = "SHA1" + RequireSignedSMIMEMessages = $False + RequireStorageCardEncryption = $False + UnapprovedInROMApplicationList = @() + UNCAccessEnabled = $True + WSSAccessEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..c2fe96cf2f --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMobileDeviceMailboxPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' + { + Name = "Default" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-ConfigureOMEConfiguration.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-ConfigureOMEConfiguration.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/2-Update.ps1 new file mode 100644 index 0000000000..bb802a8b64 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/2-Update.ps1 @@ -0,0 +1,33 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOMEConfiguration 'ConfigureOMEConfiguration' + { + Identity = "Contoso Marketing" + BackgroundColor = "0x00FFFF00" + DisclaimerText = "Encryption security disclaimer." + EmailText = "Encrypted message enclosed." + ExternalMailExpiryInDays = 1 # Updated Property + IntroductionText = "You have received an encypted message" + OTPEnabled = $True + PortalText = "This portal is encrypted." + SocialIdSignIn = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/3-Remove.ps1 new file mode 100644 index 0000000000..25ed2cde98 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOMEConfiguration/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOMEConfiguration 'ConfigureOMEConfiguration' + { + Identity = "Contoso Marketing" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-ConfigureEXOOfflineAddressBook.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-Create.ps1 similarity index 97% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-ConfigureEXOOfflineAddressBook.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-Create.ps1 index 2c911527ce..ce73e90fb1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-ConfigureEXOOfflineAddressBook.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/1-Create.ps1 @@ -18,7 +18,7 @@ Configuration Example { EXOOfflineAddressBook 'ConfigureOfflineAddressBook' { - Name = "Default Offline Address Book" + Name = "Integration Address Book" AddressLists = @('\Offline Global Address List') ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') DiffRetentionPeriod = "30" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/2-Update.ps1 new file mode 100644 index 0000000000..a6e6f375cf --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/2-Update.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOfflineAddressBook 'ConfigureOfflineAddressBook' + { + Name = "Integration Address Book" + AddressLists = @('\Offline Global Address List') + ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') + DiffRetentionPeriod = "30" + IsDefault = $false # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/3-Remove.ps1 new file mode 100644 index 0000000000..d8927dce08 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOfflineAddressBook/3-Remove.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOfflineAddressBook 'ConfigureOfflineAddressBook' + { + Name = "Integration Address Book" + AddressLists = @('\Offline Global Address List') + ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') + DiffRetentionPeriod = "30" + IsDefault = $true + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-ConfigureOnPremisesOrganization.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-ConfigureOnPremisesOrganization.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/2-Update.ps1 new file mode 100644 index 0000000000..8f94e907b8 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/2-Update.ps1 @@ -0,0 +1,32 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' + { + Identity = 'Contoso' + Comment = 'Mail for Contoso. Updated' # Updated Property + HybridDomains = 'contoso.com', 'sales.contoso.com' + InboundConnector = 'Inbound to Contoso' + OrganizationGuid = 'a1bc23cb-3456-bcde-abcd-feb363cacc88' + OrganizationName = 'Contoso' + OutboundConnector = 'Outbound to Contoso' + Ensure = 'Present' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/3-Remove.ps1 new file mode 100644 index 0000000000..ca38670405 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOnPremisesOrganization/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' + { + Identity = 'Contoso' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/1-ConfigureOrganizationSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/1-ConfigureOrganizationSettings.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationConfig/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-ConfigureOrganizationRelationship.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-ConfigureOrganizationRelationship.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/2-Update.ps1 new file mode 100644 index 0000000000..36971ac851 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/2-Update.ps1 @@ -0,0 +1,37 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOrganizationRelationship 'ConfigureOrganizationRelationship' + { + Name = "Contoso" + ArchiveAccessEnabled = $False # Updated Property + DeliveryReportEnabled = $True + DomainNames = "mail.contoso.com" + Enabled = $True + FreeBusyAccessEnabled = $True + FreeBusyAccessLevel = "AvailabilityOnly" + MailboxMoveEnabled = $True + MailTipsAccessEnabled = $True + MailTipsAccessLevel = "None" + PhotosEnabled = $True + TargetApplicationUri = "mail.contoso.com" + TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/3-Remove.ps1 new file mode 100644 index 0000000000..8a554c5e2a --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOrganizationRelationship/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOrganizationRelationship 'ConfigureOrganizationRelationship' + { + Name = "Contoso" + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/1-ConfigureOutboundConnector.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/1-ConfigureOutboundConnector.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/2-Update.ps1 new file mode 100644 index 0000000000..9f20787d0a --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/2-Update.ps1 @@ -0,0 +1,37 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOutboundConnector 'ConfigureOutboundConnector' + { + Identity = "Contoso Outbound Connector" + AllAcceptedDomains = $True + CloudServicesMailEnabled = $True + Comment = "Outbound connector to Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $False # Updated Property + IsTransportRuleScoped = $True + RecipientDomains = "*.contoso.com" + RouteAllMessagesViaOnPremises = $True + TlsDomain = "*.contoso.com" + TlsSettings = "DomainValidation" + UseMxRecord = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/3-Remove.ps1 new file mode 100644 index 0000000000..a9841310b1 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOutboundConnector/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOutboundConnector 'ConfigureOutboundConnector' + { + Identity = "Contoso Outbound Connector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-ConfigureOwaMailboxPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-Create.ps1 similarity index 99% rename from Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-ConfigureOwaMailboxPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-Create.ps1 index 7d4bae417f..1a725a4c29 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-ConfigureOwaMailboxPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' { - Name = "OwaMailboxPolicy-Default" + Name = "OwaMailboxPolicy-Integration" ActionForUnknownFileAndMIMETypes = "ForceSave" ActiveSyncIntegrationEnabled = $True AdditionalStorageProvidersAvailable = $True diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/2-Update.ps1 new file mode 100644 index 0000000000..b6fe6ee87d --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/2-Update.ps1 @@ -0,0 +1,96 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' + { + Name = "OwaMailboxPolicy-Integration" + ActionForUnknownFileAndMIMETypes = "ForceSave" + ActiveSyncIntegrationEnabled = $True + AdditionalStorageProvidersAvailable = $True + AllAddressListsEnabled = $True + AllowCopyContactsToDeviceAddressBook = $True + AllowedFileTypes = @(".rpmsg",".xlsx",".xlsm",".xlsb",".tiff",".pptx",".pptm",".ppsx",".ppsm",".docx",".docm",".zip",".xls",".wmv",".wma",".wav",".vsd",".txt",".tif",".rtf",".pub",".ppt",".png",".pdf",".one",".mp3",".jpg",".gif",".doc",".bmp",".avi") + AllowedMimeTypes = @("image/jpeg","image/png","image/gif","image/bmp") + BlockedFileTypes = @(".settingcontent-ms",".printerexport",".appcontent-ms",".appref-ms",".vsmacros",".website",".msh2xml",".msh1xml",".diagcab",".webpnp",".ps2xml",".ps1xml",".mshxml",".gadget",".theme",".psdm1",".mhtml",".cdxml",".xbap",".vhdx",".pyzw",".pssc",".psd1",".psc2",".psc1",".msh2",".msh1",".jnlp",".aspx",".appx",".xnk",".xml",".xll",".wsh",".wsf",".wsc",".wsb",".vsw",".vst",".vss",".vhd",".vbs",".vbp",".vbe",".url",".udl",".tmp",".shs",".shb",".sct",".scr",".scf",".reg",".pyz",".pyw",".pyo",".pyc",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".msu",".mst",".msp",".msi",".msh",".msc",".mht",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".mcf",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".jar",".its",".isp",".ins",".inf",".htc",".hta",".hpj",".hlp",".grp",".fxp",".exe",".der",".csh",".crt",".cpl",".com",".cnt",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".apk",".adp",".ade",".ws",".vb",".py",".pl",".js") + BlockedMimeTypes = @("application/x-javascript","application/javascript","application/msaccess","x-internet-signup","text/javascript","application/xml","application/prg","application/hta","text/scriplet","text/xml") + ClassicAttachmentsEnabled = $True + ConditionalAccessPolicy = "Off" + DefaultTheme = "" + DirectFileAccessOnPrivateComputersEnabled = $True + DirectFileAccessOnPublicComputersEnabled = $False # Updated Property + DisplayPhotosEnabled = $True + ExplicitLogonEnabled = $True + ExternalImageProxyEnabled = $True + ForceSaveAttachmentFilteringEnabled = $False + ForceSaveFileTypes = @(".vsmacros",".ps2xml",".ps1xml",".mshxml",".gadget",".psc2",".psc1",".aspx",".wsh",".wsf",".wsc",".vsw",".vst",".vss",".vbs",".vbe",".url",".tmp",".swf",".spl",".shs",".shb",".sct",".scr",".scf",".reg",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".mst",".msp",".msi",".msh",".msc",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".its",".isp",".ins",".inf",".hta",".hlp",".fxp",".exe",".dir",".dcr",".csh",".crt",".cpl",".com",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".adp",".ade",".ws",".vb",".js") + ForceSaveMimeTypes = @("Application/x-shockwave-flash","Application/octet-stream","Application/futuresplash","Application/x-director") + ForceWacViewingFirstOnPrivateComputers = $False + ForceWacViewingFirstOnPublicComputers = $False + FreCardsEnabled = $True + GlobalAddressListEnabled = $True + GroupCreationEnabled = $True + InstantMessagingEnabled = $True + InstantMessagingType = "Ocs" + InterestingCalendarsEnabled = $True + IRMEnabled = $True + IsDefault = $True + JournalEnabled = $True + LocalEventsEnabled = $False + LogonAndErrorLanguage = 0 + NotesEnabled = $True + NpsSurveysEnabled = $True + OnSendAddinsEnabled = $False + OrganizationEnabled = $True + OutboundCharset = "AutoDetect" + OutlookBetaToggleEnabled = $True + OWALightEnabled = $True + PersonalAccountCalendarsEnabled = $True + PhoneticSupportEnabled = $False + PlacesEnabled = $True + PremiumClientEnabled = $True + PrintWithoutDownloadEnabled = $True + PublicFoldersEnabled = $True + RecoverDeletedItemsEnabled = $True + ReferenceAttachmentsEnabled = $True + RemindersAndNotificationsEnabled = $True + ReportJunkEmailEnabled = $True + RulesEnabled = $True + SatisfactionEnabled = $True + SaveAttachmentsToCloudEnabled = $True + SearchFoldersEnabled = $True + SetPhotoEnabled = $True + SetPhotoURL = "" + SignaturesEnabled = $True + SkipCreateUnifiedGroupCustomSharepointClassification = $True + TeamSnapCalendarsEnabled = $True + TextMessagingEnabled = $True + ThemeSelectionEnabled = $True + UMIntegrationEnabled = $True + UseGB18030 = $False + UseISO885915 = $False + UserVoiceEnabled = $True + WacEditingEnabled = $True + WacExternalServicesEnabled = $True + WacOMEXEnabled = $False + WacViewingOnPrivateComputersEnabled = $True + WacViewingOnPublicComputersEnabled = $True + WeatherEnabled = $True + WebPartsFrameOptionsType = "SameOrigin" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..c443618a36 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOOwaMailboxPolicy/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' + { + Name = "OwaMailboxPolicy-Integration" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-ConfigurePartnerApplication.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-ConfigurePartnerApplication.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/2-Update.ps1 new file mode 100644 index 0000000000..29be55ca27 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPartnerApplication 'ConfigurePartnerApplication' + { + Name = "HRApp" + ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" + AccountType = "OrganizationalAccount" + Enabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/3-Remove.ps1 new file mode 100644 index 0000000000..2cb2adb985 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPartnerApplication/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPartnerApplication 'ConfigurePartnerApplication' + { + Name = "HRApp" + ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/1-ConfigurePerimeterConfiguration.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/1-ConfigurePerimeterConfiguration.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOPerimeterConfiguration/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-ConfigurePlace.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 similarity index 85% rename from Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-ConfigurePlace.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 index 6a0952ab08..8f4d109c68 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-ConfigurePlace.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 @@ -14,6 +14,7 @@ Configuration Example Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOPlace 'TestPlace' @@ -21,10 +22,10 @@ Configuration Example AudioDeviceName = "MyAudioDevice"; Capacity = 15; #Drift City = ""; - Credential = $credential + Credential = $Credscredential DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Present' - Identity = "MyRoom@$contoso.com"; + Identity = "MyRoom@$Domain"; IsWheelChairAccessible = $True; MTREnabled = $False; ParentType = "None"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 new file mode 100644 index 0000000000..09df00c57c --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 @@ -0,0 +1,37 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $credential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOPlace 'TestPlace' + { + AudioDeviceName = "MyAudioDevice"; + Capacity = 16; # Updated Property + City = ""; + Credential = $Credscredential + DisplayDeviceName = "DisplayDeviceName"; + Ensure = 'Present' + Identity = "MyRoom@$Domain"; + IsWheelChairAccessible = $True; + MTREnabled = $False; + ParentType = "None"; + Phone = "555-555-5555"; + Tags = @("Tag1", "Tag2"); + VideoDeviceName = "VideoDevice"; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 new file mode 100644 index 0000000000..2f29dd1360 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $credential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOPlace 'TestPlace' + { + AudioDeviceName = "MyAudioDevice"; + Credential = $Credscredential + DisplayDeviceName = "DisplayDeviceName"; + Ensure = 'Absent' + Identity = "MyRoom@$Domain"; + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-ConfigurePolicyTipConfig.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-ConfigurePolicyTipConfig.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/2-Update.ps1 new file mode 100644 index 0000000000..1d23f23daf --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/2-Update.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPolicyTipConfig 'ConfigurePolicyTipConfig' + { + Name = "en\NotifyOnly" + Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/3-Remove.ps1 new file mode 100644 index 0000000000..aae3186d10 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPolicyTipConfig/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPolicyTipConfig 'ConfigurePolicyTipConfig' + { + Name = "en\NotifyOnly" + Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-ConfigureQuarantinePolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-Create.ps1 similarity index 84% rename from Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-ConfigureQuarantinePolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-Create.ps1 index 50af10b486..03e8295d46 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-ConfigureQuarantinePolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/1-Create.ps1 @@ -13,13 +13,14 @@ Configuration Example $OrganizationName = $Credscredential.UserName.Split('@')[1] Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { EndUserQuarantinePermissionsValue = 87; ESNEnabled = $False; - Identity = "$OrganizationName\DefaultFullAccessPolicy"; + Identity = "$Domain\DefaultFullAccessPolicy"; Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/2-Update.ps1 new file mode 100644 index 0000000000..feb94715b4 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + $OrganizationName = $Credscredential.UserName.Split('@')[1] + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOQuarantinePolicy 'ConfigureQuarantinePolicy' + { + EndUserQuarantinePermissionsValue = 87; + ESNEnabled = $True; # Updated Property + Identity = "$Domain\DefaultFullAccessPolicy"; + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/3-Remove.ps1 new file mode 100644 index 0000000000..0281fc3468 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOQuarantinePolicy/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + $OrganizationName = $Credscredential.UserName.Split('@')[1] + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOQuarantinePolicy 'ConfigureQuarantinePolicy' + { + Identity = "$Domain\DefaultFullAccessPolicy"; + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-ConfigureRemoteDomain.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-Create.ps1 similarity index 96% rename from Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-ConfigureRemoteDomain.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-Create.ps1 index 9bd7084585..2bc4e0aee5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-ConfigureRemoteDomain.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 { - Identity = "Default" + Identity = "Integration" AllowedOOFType = "External" AutoForwardEnabled = $True AutoReplyEnabled = $True diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/2-Update.ps1 new file mode 100644 index 0000000000..beeaa531a9 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/2-Update.ps1 @@ -0,0 +1,43 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 + { + Identity = "Integration" + AllowedOOFType = "External" + AutoForwardEnabled = $True + AutoReplyEnabled = $False # Updated Property + ByteEncoderTypeFor7BitCharsets = "Undefined" + CharacterSet = "iso-8859-1" + ContentType = "MimeHtmlText" + DeliveryReportEnabled = $True + DisplaySenderName = $True + DomainName = "*" + IsInternal = $False + LineWrapSize = "Unlimited" + MeetingForwardNotificationEnabled = $False + Name = "Default" + NonMimeCharacterSet = "iso-8859-1" + PreferredInternetCodePageForShiftJis = "Undefined" + TargetDeliveryDomain = $False + TrustedMailInboundEnabled = $False + TrustedMailOutboundEnabled = $False + UseSimpleDisplayName = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/3-Remove.ps1 new file mode 100644 index 0000000000..2ec3881cd3 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORemoteDomain/3-Remove.ps1 @@ -0,0 +1,24 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 + { + Identity = "Integration" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/1-ConfigureReportSubmissionPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/1-ConfigureReportSubmissionPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionPolicy/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/1-ConfigureReportSubmissionRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/1-ConfigureReportSubmissionRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOReportSubmissionRule/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/1-ConfigureResourceConfiguration.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/1-ConfigureResourceConfiguration.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOResourceConfiguration/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-ConfigureRoleAssignmentPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-ConfigureRoleAssignmentPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-Create.ps1 index 4841f189bd..e4ac25a96a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-ConfigureRoleAssignmentPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' { - Name = "Default Role Assignment Policy" + Name = "Integration Policy" Description = "This policy grants end users the permission to set their options in Outlook on the web and perform other self-administration tasks." IsDefault = $True Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/2-Update.ps1 new file mode 100644 index 0000000000..7005a4835f --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/2-Update.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' + { + Name = "Integration Policy" + Description = "This policy grants end users the permission to set their options in Outlook on the web and perform other self-administration tasks." + IsDefault = $False # Updated Property + Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..f00c24b593 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleAssignmentPolicy/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' + { + Name = "Integration Policy" + IsDefault = $False # Updated Property + Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-ConfigureRoleGroup.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-ConfigureRoleGroup.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/2-Update.ps1 new file mode 100644 index 0000000000..e8546060e8 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/2-Update.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleGroup 'ConfigureRoleGroup' + { + Name = "Contoso Role Group" + Description = "Address Lists Role for Exchange Administrators. Updated" # Updated Property + Members = @("Exchange Administrator") + Roles = @("Address Lists") + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/3-Remove.ps1 new file mode 100644 index 0000000000..b897864cc5 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXORoleGroup/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleGroup 'ConfigureRoleGroup' + { + Name = "Contoso Role Group" + Members = @("Exchange Administrator") + Roles = @("Address Lists") + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-ConfigureSafeAttachmentPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-Create.ps1 similarity index 86% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-ConfigureSafeAttachmentPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-Create.ps1 index 486bd307dd..d670be256a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-ConfigureSafeAttachmentPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/1-Create.ps1 @@ -13,6 +13,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' @@ -20,7 +21,7 @@ Configuration Example Identity = "Marketing Block Attachments" Enable = $True Redirect = $True - RedirectAddress = "admin@contoso.com" + RedirectAddress = "admin@$Domain" Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/2-Update.ps1 new file mode 100644 index 0000000000..2caf85bed1 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/2-Update.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' + { + Identity = "Marketing Block Attachments" + Enable = $False # Updated Property + Redirect = $True + RedirectAddress = "admin@$Domain" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..fb3378fa92 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentPolicy/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' + { + Identity = "Marketing Block Attachments" + Enable = $False # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-ConfigureSafeAttachmentRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-Create.ps1 similarity index 92% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-ConfigureSafeAttachmentRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-Create.ps1 index 5e44a65fd5..b10f42c4aa 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-ConfigureSafeAttachmentRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/1-Create.ps1 @@ -21,7 +21,7 @@ Configuration Example Comments = "Applies to Research Department, except managers" Enabled = $True ExceptIfSentToMemberOf = "Research Department Managers" - SafeAttachmentPolicy = "Research Block Attachments" + SafeAttachmentPolicy = "Marketing Block Attachments" SentToMemberOf = "Research Department" Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/2-Update.ps1 new file mode 100644 index 0000000000..7b064d7d99 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/2-Update.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' + { + Identity = "Research Department Attachment Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeAttachmentPolicy = "Marketing Block Attachments" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/3-Remove.ps1 new file mode 100644 index 0000000000..3ba7d01996 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeAttachmentRule/3-Remove.ps1 @@ -0,0 +1,29 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' + { + Identity = "Research Department Attachment Rule" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeAttachmentPolicy = "Marketing Block Attachments" + SentToMemberOf = "Research Department" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-ConfigureSafeLinksPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-ConfigureSafeLinksPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/2-Update.ps1 new file mode 100644 index 0000000000..09de5e45b7 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/2-Update.ps1 @@ -0,0 +1,32 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' + { + Identity = 'Marketing Block URL' + AdminDisplayName = 'Marketing Block URL' + CustomNotificationText = 'Blocked URLs for Marketing' + DeliverMessageAfterScan = $True + EnableOrganizationBranding = $False # Updated Property + EnableSafeLinksForTeams = $True + ScanUrls = $True + UseTranslatedNotificationText = $True + Ensure = 'Present' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..f8659eed81 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksPolicy/3-Remove.ps1 @@ -0,0 +1,25 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' + { + Identity = 'Marketing Block URL' + Ensure = 'Absent' + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-ConfigureSafeLinksRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-Create.ps1 similarity index 93% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-ConfigureSafeLinksRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-Create.ps1 index b239e80793..c94452d712 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-ConfigureSafeLinksRule.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/1-Create.ps1 @@ -21,7 +21,7 @@ Configuration Example Comments = "Applies to Research Department, except managers" Enabled = $True ExceptIfSentToMemberOf = "Research Department Managers" - SafeLinksPolicy = "Research Block URL" + SafeLinksPolicy = "Marketing Block URL" SentToMemberOf = "Research Department" Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/2-Update.ps1 new file mode 100644 index 0000000000..6a672a2158 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/2-Update.ps1 @@ -0,0 +1,30 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksRule 'ConfigureSafeLinksRule' + { + Identity = "Research Department URL Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeLinksPolicy = "Marketing Block URL" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/3-Remove.ps1 new file mode 100644 index 0000000000..12fe46f671 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSafeLinksRule/3-Remove.ps1 @@ -0,0 +1,28 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksRule 'ConfigureSafeLinksRule' + { + Identity = "Research Department URL Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + SafeLinksPolicy = "Marketing Block URL" + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1 - CreateSharedMailbox.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1-Create.ps1 similarity index 76% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1 - CreateSharedMailbox.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1-Create.ps1 index 1e3a12deee..b672e18961 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1 - CreateSharedMailbox.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/1-Create.ps1 @@ -12,13 +12,14 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSharedMailbox 'SharedMailbox' { DisplayName = "Test" - PrimarySMTPAddress = "Test@O365DSC1.onmicrosoft.com" - EmailAddresses = @("Joufflu@o365dsc1.onmicrosoft.com", "Gilles@O365dsc1.onmicrosoft.com") + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/2-Update.ps1 new file mode 100644 index 0000000000..a009e6f9bc --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/2-Update.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSharedMailbox 'SharedMailbox' + { + DisplayName = "Test" + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain", "AlexW@$Domain") # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/3-Remove.ps1 new file mode 100644 index 0000000000..3b1b6ce72b --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharedMailbox/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSharedMailbox 'SharedMailbox' + { + DisplayName = "Test" + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain", "AlexW@$Domain") # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-ConfigureSharingPolicy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-Create.ps1 similarity index 92% rename from Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-ConfigureSharingPolicy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-Create.ps1 index 9d86681134..ddce10e578 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-ConfigureSharingPolicy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOSharingPolicy 'ConfigureSharingPolicy' { - Name = "Default Sharing Policy" + Name = "Integration Sharing Policy" Default = $True Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/2-Update.ps1 new file mode 100644 index 0000000000..5f08c125a7 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/2-Update.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSharingPolicy 'ConfigureSharingPolicy' + { + Name = "Integration Sharing Policy" + Default = $False # Updated Property + Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/3-Remove.ps1 new file mode 100644 index 0000000000..54a8e868f4 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOSharingPolicy/3-Remove.ps1 @@ -0,0 +1,27 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSharingPolicy 'ConfigureSharingPolicy' + { + Name = "Integration Sharing Policy" + Default = $False # Updated Property + Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/1-ConfigureTransportSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/2-Update.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/1-ConfigureTransportSettings.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOTransportConfig/2-Update.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-ConfigureTransportRule.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-Create.ps1 similarity index 100% rename from Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-ConfigureTransportRule.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/1-Create.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/2-Update.ps1 new file mode 100644 index 0000000000..39e2e3a262 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/2-Update.ps1 @@ -0,0 +1,31 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOTransportRule 'ConfigureTransportRule' + { + Name = "Ethical Wall - Sales and Brokerage Departments" + BetweenMemberOf1 = "Sales Department" + BetweenMemberOf2 = "Brokerage Department" + ExceptIfFrom = "Tony Smith","Pilar Ackerman" + ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" + RejectMessageReasonText = "Updated" # Updated Property + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/3-Remove.ps1 new file mode 100644 index 0000000000..5c40c4a7b7 --- /dev/null +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOTransportRule/3-Remove.ps1 @@ -0,0 +1,26 @@ +<# +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. +#> + +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOTransportRule 'ConfigureTransportRule' + { + Name = "Ethical Wall - Sales and Brokerage Departments" + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} From 3fcf1a0836fa657a3f09a87e1068bea19cb3a162 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Mon, 22 Jan 2024 14:19:20 -0500 Subject: [PATCH 051/122] Fixes for Examples --- .../Resources/EXOCASMailboxPlan/1-Create.ps1 | 28 --------- .../Resources/EXOCASMailboxPlan/3-Remove.ps1 | 24 ------- .../EXOCASMailboxSettings/1-Create.ps1 | 52 ---------------- .../EXOCASMailboxSettings/3-Remove.ps1 | 26 -------- .../EXOCalendarProcessing/1-Create.ps1 | 62 ------------------- .../EXOCalendarProcessing/3-Remove.ps1 | 26 -------- .../EXODistributionGroup/1-Create.ps1 | 6 +- .../EXODistributionGroup/2-Update.ps1 | 6 +- .../EXODistributionGroup/3-Remove.ps1 | 4 +- .../Resources/EXOGroupSettings/2-Update.ps1 | 6 +- .../EXOMailboxCalendarFolder/1-Create.ps1 | 30 --------- .../EXOMailboxCalendarFolder/3-Remove.ps1 | 25 -------- .../EXOMailboxPermission/1-Create.ps1 | 28 --------- .../EXOMailboxPermission/3-Remove.ps1 | 28 --------- .../Resources/EXOMailboxPlan/1-Create.ps1 | 31 ---------- .../Resources/EXOMailboxPlan/3-Remove.ps1 | 24 ------- .../Resources/EXOMailboxSettings/1-Create.ps1 | 28 --------- .../Resources/EXOMailboxSettings/3-Remove.ps1 | 26 -------- .../Examples/Resources/EXOPlace/1-Create.ps1 | 2 +- .../Examples/Resources/EXOPlace/2-Update.ps1 | 2 +- .../Examples/Resources/EXOPlace/3-Remove.ps1 | 2 +- 21 files changed, 14 insertions(+), 452 deletions(-) delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/3-Remove.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/3-Remove.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/3-Remove.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/3-Remove.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/3-Remove.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/3-Remove.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/3-Remove.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-Create.ps1 deleted file mode 100644 index bd698271b2..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/1-Create.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOCASMailboxPlan 'ConfigureCASMailboxPlan' - { - ActiveSyncEnabled = $True - OwaMailboxPolicy = "OwaMailboxPolicy-Default" - PopEnabled = $True - Identity = 'ExchangeOnlineEnterprise' - ImapEnabled = $True - Ensure = "Present" - Credential = $Credscredential - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/3-Remove.ps1 deleted file mode 100644 index e449bc8191..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxPlan/3-Remove.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOCASMailboxPlan 'ConfigureCASMailboxPlan' - { - Identity = 'ExchangeOnlineEnterprise' - Ensure = "Absent" - Credential = $Credscredential - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/1-Create.ps1 deleted file mode 100644 index 7e76bf9a67..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/1-Create.ps1 +++ /dev/null @@ -1,52 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOCASMailboxSettings 'AdeleVCasMailboxSettings' - { - ActiveSyncAllowedDeviceIDs = @() - ActiveSyncBlockedDeviceIDs = @() - ActiveSyncDebugLogging = $False - ActiveSyncEnabled = $True - ActiveSyncMailboxPolicy = 'Demo EXO Mobile Device Policy Default' - ActiveSyncSuppressReadReceipt = $False - EwsEnabled = $True - Identity = 'AdeleV' - ImapEnabled = $False - ImapForceICalForCalendarRetrievalOption = $False - ImapMessagesRetrievalMimeFormat = 'BestBodyFormat' - ImapSuppressReadReceipt = $False - ImapUseProtocolDefaults = $True - MacOutlookEnabled = $True - MAPIEnabled = $True - OutlookMobileEnabled = $True - OWAEnabled = $True - OWAforDevicesEnabled = $True - OwaMailboxPolicy = 'OwaMailboxPolicy-Default' - PopEnabled = $False - PopForceICalForCalendarRetrievalOption = $True - PopMessagesRetrievalMimeFormat = 'BestBodyFormat' - PopSuppressReadReceipt = $False - PopUseProtocolDefaults = $True - PublicFolderClientAccess = $False - ShowGalAsDefaultView = $True - UniversalOutlookEnabled = $True - Ensure = 'Present' - Credential = $Credscredential - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/3-Remove.ps1 deleted file mode 100644 index 7861342a9a..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCASMailboxSettings/3-Remove.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOCASMailboxSettings 'AdeleVCasMailboxSettings' - { - Identity = 'AdeleV' - Ensure = 'Absent' - Credential = $Credscredential - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-Create.ps1 deleted file mode 100644 index 596a76a67b..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/1-Create.ps1 +++ /dev/null @@ -1,62 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - $Domain = $Credscredential.Username.Split('@')[1] - EXOCalendarProcessing "CalendarProcessing" - { - AddAdditionalResponse = $False; - AddNewRequestsTentatively = $True; - AddOrganizerToSubject = $True; - AllBookInPolicy = $True; - AllowConflicts = $False; - AllowRecurringMeetings = $True; - AllRequestInPolicy = $False; - AllRequestOutOfPolicy = $False; - AutomateProcessing = "AutoUpdate"; - BookingType = "Standard"; - BookingWindowInDays = 180; - BookInPolicy = @(); - ConflictPercentageAllowed = 0; - Credential = $credsCredential; - DeleteAttachments = $True; - DeleteComments = $True; - DeleteNonCalendarItems = $True; - DeleteSubject = $True; - EnableAutoRelease = $False; - EnableResponseDetails = $True; - EnforceCapacity = $False; - EnforceSchedulingHorizon = $True; - Ensure = "Present"; - ForwardRequestsToDelegates = $True; - Identity = "AdeleV"; - MaximumConflictInstances = 0; - MaximumDurationInMinutes = 1440; - MinimumDurationInMinutes = 0; - OrganizerInfo = $True; - PostReservationMaxClaimTimeInMinutes = 10; - ProcessExternalMeetingMessages = $False; - RemoveCanceledMeetings = $False; - RemoveForwardedMeetingNotifications = $False; - RemoveOldMeetingMessages = $False; - RemovePrivateProperty = $True; - RequestInPolicy = @("AlexW@$Domain"); - ResourceDelegates = @(); - ScheduleOnlyDuringWorkHours = $False; - TentativePendingApproval = $True; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/3-Remove.ps1 deleted file mode 100644 index 376ff04c40..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOCalendarProcessing/3-Remove.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - $Domain = $Credscredential.Username.Split('@')[1] - EXOCalendarProcessing "CalendarProcessing" - { - Credential = $credsCredential; - Ensure = "Absent"; - Identity = "AdeleV"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 index 94bff7ab26..7b5327e6d2 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/1-Create.ps1 @@ -9,13 +9,13 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credsAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXODistributionGroup 'DemoDG' { Alias = "demodg"; @@ -35,7 +35,7 @@ Configuration Example PrimarySmtpAddress = "demodg@$Domain"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; - Credential = $credsAdmin + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 index 81d407bcc2..2e59ecff8e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/2-Update.ps1 @@ -9,13 +9,13 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credsAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXODistributionGroup 'DemoDG' { Alias = "demodg"; @@ -35,7 +35,7 @@ Configuration Example PrimarySmtpAddress = "demodg@$Domain"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; - Credential = $credsAdmin + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 index 47ab50452e..5160570364 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODistributionGroup/3-Remove.ps1 @@ -9,7 +9,7 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credsAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC @@ -22,7 +22,7 @@ Configuration Example Ensure = "Absent"; Identity = "DemoDG"; Name = "DemoDG"; - Credential = $credsAdmin + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 index 8892473aa1..a7b38e6fd1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOGroupSettings/2-Update.ps1 @@ -9,14 +9,14 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credential + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXOGroupSettings 'TestGroup' { DisplayName = "Test Group"; @@ -26,7 +26,7 @@ Configuration Example AutoSubscribeNewMembers = $False; CalendarMemberReadOnly = $False; ConnectorsEnabled = $False; # Updated Property - Credential = $credential; + Credential = $Credscredential; HiddenFromAddressListsEnabled = $True; HiddenFromExchangeClientsEnabled = $True; InformationBarrierMode = "Open"; diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-Create.ps1 deleted file mode 100644 index bf6562a9e7..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/1-Create.ps1 +++ /dev/null @@ -1,30 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOMailboxCalendarFolder "JohnCalendarFolder" - { - Credential = $credsCredential; - DetailLevel = "AvailabilityOnly"; - Ensure = "Present"; - Identity = "AdeleV:\Calendar"; - PublishDateRangeFrom = "ThreeMonths"; - PublishDateRangeTo = "ThreeMonths"; - PublishEnabled = $False; - SearchableUrlEnabled = $False; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/3-Remove.ps1 deleted file mode 100644 index 0fe697312e..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxCalendarFolder/3-Remove.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOMailboxCalendarFolder "JohnCalendarFolder" - { - Credential = $credsCredential; - Ensure = "Absent"; - Identity = "AdeleV:\Calendar"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-Create.ps1 deleted file mode 100644 index 5df61e351c..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/1-Create.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOMailboxPermission "TestPermission" - { - AccessRights = @("FullAccess","ReadPermission"); - Credential = $credsCredential; - Deny = $False; - Ensure = "Present"; - Identity = "AdeleV"; - InheritanceType = "All"; - User = "NT AUTHORITY\SELF"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/3-Remove.ps1 deleted file mode 100644 index eb3fc87f07..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPermission/3-Remove.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $credsCredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOMailboxPermission "TestPermission" - { - AccessRights = @("FullAccess","ReadPermission"); - Credential = $credsCredential; - Deny = $True; # Updated Property - Ensure = "Absent"; - Identity = "AdeleV"; - InheritanceType = "All"; - User = "NT AUTHORITY\SELF"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-Create.ps1 deleted file mode 100644 index 52a5907e55..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/1-Create.ps1 +++ /dev/null @@ -1,31 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOMailboxPlan 'ConfigureMailboxPlan' - { - Ensure = "Present"; - Identity = "Integration Plan"; - IssueWarningQuota = "98 GB (105,226,698,752 bytes)"; - MaxReceiveSize = "25 MB (26,214,400 bytes)"; - MaxSendSize = "25 MB (26,214,400 bytes)"; - ProhibitSendQuota = "99 GB (106,300,440,576 bytes)"; - ProhibitSendReceiveQuota = "100 GB (107,374,182,400 bytes)"; - RetainDeletedItemsFor = "14.00:00:00"; - RoleAssignmentPolicy = "Default Role Assignment Policy"; - Credential = $Credscredential - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/3-Remove.ps1 deleted file mode 100644 index 1f0e129ffc..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxPlan/3-Remove.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOMailboxPlan 'ConfigureMailboxPlan' - { - Ensure = "Absent"; - Identity = "Integration Plan"; - Credential = $Credscredential - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/1-Create.ps1 deleted file mode 100644 index 615e477505..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/1-Create.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOMailboxSettings 'OttawaTeamMailboxSettings' - { - DisplayName = 'Ottawa Employees' - TimeZone = 'Eastern Standard Time' - Locale = 'fr-CA' - Ensure = 'Present' - Credential = $Credscredential - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/3-Remove.ps1 deleted file mode 100644 index 9c29e03011..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxSettings/3-Remove.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param - ( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXOMailboxSettings 'OttawaTeamMailboxSettings' - { - DisplayName = 'Ottawa Employees' - Ensure = 'Absent' - Credential = $Credscredential - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 index 8f4d109c68..a520894b77 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/1-Create.ps1 @@ -9,7 +9,7 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credential + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 index 09df00c57c..0652a062c7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/2-Update.ps1 @@ -9,7 +9,7 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credential + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 index 2f29dd1360..9be622e644 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOPlace/3-Remove.ps1 @@ -9,7 +9,7 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credential + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC From 919ba2994325c44d6dd41138d8cbfe993de3d45c Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Mon, 22 Jan 2024 20:16:33 +0000 Subject: [PATCH 052/122] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/azure-ad/AADGroup.md | 2 +- .../resources/exchange/EXOAcceptedDomain.md | 66 ++++++++- .../exchange/EXOActiveSyncDeviceAccessRule.md | 62 +++++++++ .../exchange/EXOAddressBookPolicy.md | 60 ++++++++ .../docs/resources/exchange/EXOAddressList.md | 58 ++++++++ .../resources/exchange/EXOAntiPhishPolicy.md | 92 +++++++++++++ .../resources/exchange/EXOAntiPhishRule.md | 65 +++++++++ .../exchange/EXOApplicationAccessPolicy.md | 62 ++++++++- .../exchange/EXOAuthenticationPolicy.md | 78 +++++++++++ .../EXOAuthenticationPolicyAssignment.md | 54 +++++++- .../exchange/EXOAvailabilityAddressSpace.md | 61 +++++++++ .../exchange/EXOAvailabilityConfig.md | 61 ++++++++- .../resources/exchange/EXOCASMailboxPlan.md | 4 +- .../exchange/EXOCASMailboxSettings.md | 2 +- .../exchange/EXOCalendarProcessing.md | 7 +- .../resources/exchange/EXOClientAccessRule.md | 67 +++++++++ .../exchange/EXODataClassification.md | 62 +++++++++ .../exchange/EXODataEncryptionPolicy.md | 57 ++++++++ .../exchange/EXODistributionGroup.md | 88 +++++++++++- .../exchange/EXODkimSigningConfig.md | 59 ++++++++ .../exchange/EXOEmailAddressPolicy.md | 69 +++++++++- .../exchange/EXOGlobalAddressList.md | 59 ++++++++ .../resources/exchange/EXOGroupSettings.md | 9 +- .../EXOHostedConnectionFilterPolicy.md | 61 ++++++++- .../exchange/EXOHostedContentFilterPolicy.md | 98 +++++++++++++- .../exchange/EXOHostedContentFilterRule.md | 63 ++++++++- .../EXOHostedOutboundSpamFilterPolicy.md | 66 ++++++++- .../EXOHostedOutboundSpamFilterRule.md | 66 ++++++++- .../resources/exchange/EXOInboundConnector.md | 65 +++++++++ .../exchange/EXOIntraOrganizationConnector.md | 59 ++++++++ .../docs/resources/exchange/EXOJournalRule.md | 65 ++++++++- .../docs/resources/exchange/EXOMailContact.md | 80 ++++++++++- docs/docs/resources/exchange/EXOMailTips.md | 64 ++++++++- .../EXOMailboxAutoReplyConfiguration.md | 69 +++++++++- .../exchange/EXOMailboxCalendarFolder.md | 4 +- .../exchange/EXOMailboxPermission.md | 4 +- .../docs/resources/exchange/EXOMailboxPlan.md | 4 +- .../resources/exchange/EXOMailboxSettings.md | 2 +- .../exchange/EXOMalwareFilterPolicy.md | 64 ++++++++- .../exchange/EXOMalwareFilterRule.md | 63 ++++++++- .../resources/exchange/EXOManagementRole.md | 58 ++++++++ .../exchange/EXOManagementRoleAssignment.md | 60 +++++++- .../exchange/EXOMessageClassification.md | 65 +++++++++ .../exchange/EXOMobileDeviceMailboxPolicy.md | 107 +++++++++++++++ .../resources/exchange/EXOOMEConfiguration.md | 64 +++++++++ .../exchange/EXOOfflineAddressBook.md | 68 +++++++++- .../exchange/EXOOnPremisesOrganization.md | 63 +++++++++ .../exchange/EXOOrganizationRelationship.md | 69 ++++++++++ .../exchange/EXOOutboundConnector.md | 68 ++++++++++ .../resources/exchange/EXOOwaMailboxPolicy.md | 128 +++++++++++++++++- .../exchange/EXOPartnerApplication.md | 60 ++++++++ docs/docs/resources/exchange/EXOPlace.md | 79 ++++++++++- .../resources/exchange/EXOPolicyTipConfig.md | 58 ++++++++ .../resources/exchange/EXOQuarantinePolicy.md | 63 ++++++++- .../resources/exchange/EXORemoteDomain.md | 75 +++++++++- .../exchange/EXORoleAssignmentPolicy.md | 61 ++++++++- docs/docs/resources/exchange/EXORoleGroup.md | 61 +++++++++ .../exchange/EXOSafeAttachmentPolicy.md | 65 ++++++++- .../exchange/EXOSafeAttachmentRule.md | 67 ++++++++- .../resources/exchange/EXOSafeLinksPolicy.md | 63 +++++++++ .../resources/exchange/EXOSafeLinksRule.md | 66 ++++++++- .../resources/exchange/EXOSharedMailbox.md | 65 ++++++++- .../resources/exchange/EXOSharingPolicy.md | 62 ++++++++- .../resources/exchange/EXOTransportRule.md | 63 +++++++++ 64 files changed, 3693 insertions(+), 66 deletions(-) diff --git a/docs/docs/resources/azure-ad/AADGroup.md b/docs/docs/resources/azure-ad/AADGroup.md index dccb5a9313..d2d18e4949 100644 --- a/docs/docs/resources/azure-ad/AADGroup.md +++ b/docs/docs/resources/azure-ad/AADGroup.md @@ -57,7 +57,7 @@ To authenticate with the Microsoft Graph API, this resource required the followi - **Update** - - Group.Read.All, Group.ReadWrite.All, Organization.Read.All, RoleManagement.Read.Directory, RoleManagement.ReadWrite.Directory, User.Read.All, ReportSettings.ReadWrite.All + - Group.ReadWrite.All, Organization.Read.All, RoleManagement.ReadWrite.Directory, User.Read.All, ReportSettings.ReadWrite.All #### Application permissions diff --git a/docs/docs/resources/exchange/EXOAcceptedDomain.md b/docs/docs/resources/exchange/EXOAcceptedDomain.md index 6e3d82d2d7..088c787201 100644 --- a/docs/docs/resources/exchange/EXOAcceptedDomain.md +++ b/docs/docs/resources/exchange/EXOAcceptedDomain.md @@ -56,10 +56,68 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'contoso.com' - DomainType = "Authoritative" - Ensure = "Present" - Credential = $Credscredential + Identity = 'contoso.com' + DomainType = "Authoritative" + OutboundOnly = $false + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAcceptedDomain 'O365DSCDomain' + { + Identity = 'contoso.com' + DomainType = "Authoritative" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAcceptedDomain 'O365DSCDomain' + { + Identity = 'contoso.com' + DomainType = "Authoritative" + OutboundOnly = $true # Updated Property + Ensure = "Present" + Credential = $Credscredential } } } diff --git a/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md b/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md index 6f8c3bed60..2819cf2989 100644 --- a/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md +++ b/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md @@ -68,3 +68,65 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' + { + Identity = "ContosoPhone(DeviceOS)" + Characteristic = "DeviceModel" # Updated Property + QueryString = "iOS 6.1 10B145" + AccessLevel = "Allow" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' + { + Identity = "ContosoPhone(DeviceOS)" + Characteristic = "DeviceModel" # Updated Property + QueryString = "iOS 6.1 10B145" + AccessLevel = "Allow" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAddressBookPolicy.md b/docs/docs/resources/exchange/EXOAddressBookPolicy.md index e74c5ec8ed..ae74810210 100644 --- a/docs/docs/resources/exchange/EXOAddressBookPolicy.md +++ b/docs/docs/resources/exchange/EXOAddressBookPolicy.md @@ -70,3 +70,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressBookPolicy 'ConfigureAddressBookPolicy' + { + Name = "All Fabrikam ABP" + AddressLists = "\All Fabrikam","\All Fabrikam Mailboxes","\All Fabrikam Contacts" # Updated Property + RoomList = "\All Fabrikam-Rooms" + OfflineAddressBook = "\Fabrikam-All-OAB" + GlobalAddressList = "\All Fabrikam" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressBookPolicy 'ConfigureAddressBookPolicy' + { + Name = "All Fabrikam ABP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAddressList.md b/docs/docs/resources/exchange/EXOAddressList.md index 942e94f8bb..db9260e246 100644 --- a/docs/docs/resources/exchange/EXOAddressList.md +++ b/docs/docs/resources/exchange/EXOAddressList.md @@ -86,3 +86,61 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressList 'HRUsersAddressList' + { + Name = "HR Users" + ConditionalCompany = "Contoso" + ConditionalDepartment = "HR2" # Updated Property + ConditionalStateOrProvince = "US" + IncludedRecipients = "AllRecipients" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAddressList 'HRUsersAddressList' + { + Name = "HR Users" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAntiPhishPolicy.md b/docs/docs/resources/exchange/EXOAntiPhishPolicy.md index 1c27b27741..af3d8f579b 100644 --- a/docs/docs/resources/exchange/EXOAntiPhishPolicy.md +++ b/docs/docs/resources/exchange/EXOAntiPhishPolicy.md @@ -114,3 +114,95 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' + { + Identity = "Our Rule" + MakeDefault = $null + PhishThresholdLevel = 2 # Updated Property + EnableTargetedDomainsProtection = $null + Enabled = $null + TargetedDomainsToProtect = $null + EnableSimilarUsersSafetyTips = $null + ExcludedDomains = $null + TargetedDomainActionRecipients = $null + EnableMailboxIntelligence = $null + EnableSimilarDomainsSafetyTips = $null + AdminDisplayName = "" + AuthenticationFailAction = "MoveToJmf" + TargetedUserProtectionAction = "NoAction" + TargetedUsersToProtect = $null + EnableTargetedUserProtection = $null + ExcludedSenders = $null + EnableOrganizationDomainsProtection = $null + EnableUnusualCharactersSafetyTips = $null + TargetedUserActionRecipients = $null + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' + { + Identity = "Our Rule" + MakeDefault = $null + PhishThresholdLevel = 2 # Updated Property + EnableTargetedDomainsProtection = $null + Enabled = $null + TargetedDomainsToProtect = $null + EnableSimilarUsersSafetyTips = $null + ExcludedDomains = $null + TargetedDomainActionRecipients = $null + EnableMailboxIntelligence = $null + EnableSimilarDomainsSafetyTips = $null + AdminDisplayName = "" + AuthenticationFailAction = "MoveToJmf" + TargetedUserProtectionAction = "NoAction" + TargetedUsersToProtect = $null + EnableTargetedUserProtection = $null + ExcludedSenders = $null + EnableOrganizationDomainsProtection = $null + EnableUnusualCharactersSafetyTips = $null + TargetedUserActionRecipients = $null + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAntiPhishRule.md b/docs/docs/resources/exchange/EXOAntiPhishRule.md index 46f2016d29..c43ea8d007 100644 --- a/docs/docs/resources/exchange/EXOAntiPhishRule.md +++ b/docs/docs/resources/exchange/EXOAntiPhishRule.md @@ -82,3 +82,68 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishRule 'ConfigureAntiPhishRule' + { + Identity = "Test Rule" + ExceptIfSentToMemberOf = $null + ExceptIfSentTo = $null + SentTo = $null + ExceptIfRecipientDomainIs = $null + Comments = $null + AntiPhishPolicy = "Our Rule" + RecipientDomainIs = $null + Enabled = $True + SentToMemberOf = @("msteams_bb15d4@contoso.onmicrosoft.com") + Priority = 2 # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAntiPhishRule 'ConfigureAntiPhishRule' + { + Identity = "Test Rule" + AntiPhishPolicy = "Our Rule" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md b/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md index d84d3f17c2..0240a99e8e 100644 --- a/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md +++ b/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md @@ -60,7 +60,7 @@ Configuration Example { Identity = "Global" AccessRight = "DenyAccess" - AppID = "3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93" + AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") PolicyScopeGroupId = "Engineering Staff" Description = "Engineering Group Policy" Ensure = "Present" @@ -70,3 +70,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' + { + Identity = "Global" + AccessRight = "DenyAccess" + AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") + PolicyScopeGroupId = "Engineering Staff" + Description = "Engineering Group Policy Updated" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' + { + Identity = "Global" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAuthenticationPolicy.md b/docs/docs/resources/exchange/EXOAuthenticationPolicy.md index ddf4a3d03d..c873435a65 100644 --- a/docs/docs/resources/exchange/EXOAuthenticationPolicy.md +++ b/docs/docs/resources/exchange/EXOAuthenticationPolicy.md @@ -85,3 +85,81 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' + { + Identity = "Block Basic Auth" + AllowBasicAuthActiveSync = $False + AllowBasicAuthAutodiscover = $False + AllowBasicAuthImap = $False + AllowBasicAuthMapi = $True # Updated Property + AllowBasicAuthOfflineAddressBook = $False + AllowBasicAuthOutlookService = $False + AllowBasicAuthPop = $False + AllowBasicAuthPowerShell = $False + AllowBasicAuthReportingWebServices = $False + AllowBasicAuthRpc = $False + AllowBasicAuthSmtp = $False + AllowBasicAuthWebServices = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' + { + Identity = "Block Basic Auth" + AllowBasicAuthActiveSync = $False + AllowBasicAuthAutodiscover = $False + AllowBasicAuthImap = $False + AllowBasicAuthMapi = $True # Updated Property + AllowBasicAuthOfflineAddressBook = $False + AllowBasicAuthOutlookService = $False + AllowBasicAuthPop = $False + AllowBasicAuthPowerShell = $False + AllowBasicAuthReportingWebServices = $False + AllowBasicAuthRpc = $False + AllowBasicAuthSmtp = $False + AllowBasicAuthWebServices = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md b/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md index 24a24686de..d2a7dc46cb 100644 --- a/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md +++ b/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md @@ -52,7 +52,33 @@ Configuration Example { EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' { - UserName = "John.Smith" + UserName = "AdeleV" + AuthenticationPolicyName = "Block Basic Auth" + Ensure = "Present" + Credential = $EXOAdmin + } + } +} +``` + +### Example 2 + + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $EXOAdmin + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' + { + UserName = "AdeleV" AuthenticationPolicyName = "Test Policy" Ensure = "Present" Credential = $EXOAdmin @@ -61,3 +87,29 @@ Configuration Example } ``` +### Example 3 + + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $EXOAdmin + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' + { + UserName = "AdeleV" + AuthenticationPolicyName = "Test Policy" + Ensure = "Absent" + Credential = $EXOAdmin + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md b/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md index 1fb3bfd413..f9230a9cd6 100644 --- a/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md +++ b/docs/docs/resources/exchange/EXOAvailabilityAddressSpace.md @@ -70,3 +70,64 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' + { + Identity = 'Contoso.com' + AccessMethod = 'OrgWideFBBasic' # Updated Property + ForestName = 'example.contoso.com' + TargetAutodiscoverEpr = 'https://contoso.com/autodiscover/autodiscover.xml' + Ensure = 'Present' + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' + { + Identity = 'Contoso.com' + Ensure = 'Absent' + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOAvailabilityConfig.md b/docs/docs/resources/exchange/EXOAvailabilityConfig.md index cbe46c3d3c..ce63313322 100644 --- a/docs/docs/resources/exchange/EXOAvailabilityConfig.md +++ b/docs/docs/resources/exchange/EXOAvailabilityConfig.md @@ -50,11 +50,12 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAvailabilityConfig 'ConfigureAvailabilityConfig' { - OrgWideAccount = "admin@contoso.onmicrosoft.com" + OrgWideAccount = "adelev@$Domain" Ensure = "Present" Credential = $Credscredential } @@ -62,3 +63,61 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAvailabilityConfig 'ConfigureAvailabilityConfig' + { + OrgWideAccount = "alexW@$Domain" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOAvailabilityConfig 'ConfigureAvailabilityConfig' + { + OrgWideAccount = "alexW@$Domain" # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOCASMailboxPlan.md b/docs/docs/resources/exchange/EXOCASMailboxPlan.md index cf19d2a738..44b9628e75 100644 --- a/docs/docs/resources/exchange/EXOCASMailboxPlan.md +++ b/docs/docs/resources/exchange/EXOCASMailboxPlan.md @@ -60,8 +60,8 @@ Configuration Example { ActiveSyncEnabled = $True OwaMailboxPolicy = "OwaMailboxPolicy-Default" - PopEnabled = $True - Identity = $CASIdentity + PopEnabled = $False # Updated Property + Identity = 'ExchangeOnlineEnterprise' ImapEnabled = $True Ensure = "Present" Credential = $Credscredential diff --git a/docs/docs/resources/exchange/EXOCASMailboxSettings.md b/docs/docs/resources/exchange/EXOCASMailboxSettings.md index c0da9659ab..d4453b4317 100644 --- a/docs/docs/resources/exchange/EXOCASMailboxSettings.md +++ b/docs/docs/resources/exchange/EXOCASMailboxSettings.md @@ -97,7 +97,7 @@ Configuration Example ActiveSyncSuppressReadReceipt = $False EwsEnabled = $True Identity = 'AdeleV' - ImapEnabled = $False + ImapEnabled = $True # Updated Property ImapForceICalForCalendarRetrievalOption = $False ImapMessagesRetrievalMimeFormat = 'BestBodyFormat' ImapSuppressReadReceipt = $False diff --git a/docs/docs/resources/exchange/EXOCalendarProcessing.md b/docs/docs/resources/exchange/EXOCalendarProcessing.md index c4c102dcb4..c01c29cc4d 100644 --- a/docs/docs/resources/exchange/EXOCalendarProcessing.md +++ b/docs/docs/resources/exchange/EXOCalendarProcessing.md @@ -90,11 +90,12 @@ Configuration Example node localhost { + $Domain = $Credscredential.Username.Split('@')[1] EXOCalendarProcessing "CalendarProcessing" { AddAdditionalResponse = $False; AddNewRequestsTentatively = $True; - AddOrganizerToSubject = $True; + AddOrganizerToSubject = $False; # Updated Property AllBookInPolicy = $True; AllowConflicts = $False; AllowRecurringMeetings = $True; @@ -116,7 +117,7 @@ Configuration Example EnforceSchedulingHorizon = $True; Ensure = "Present"; ForwardRequestsToDelegates = $True; - Identity = "John.Smith"; + Identity = "AdeleV"; MaximumConflictInstances = 0; MaximumDurationInMinutes = 1440; MinimumDurationInMinutes = 0; @@ -127,7 +128,7 @@ Configuration Example RemoveForwardedMeetingNotifications = $False; RemoveOldMeetingMessages = $False; RemovePrivateProperty = $True; - RequestInPolicy = @("Bob.Houle@$OrganizationName"); + RequestInPolicy = @("AlexW@$Domain"); ResourceDelegates = @(); ScheduleOnlyDuringWorkHours = $False; TentativePendingApproval = $True; diff --git a/docs/docs/resources/exchange/EXOClientAccessRule.md b/docs/docs/resources/exchange/EXOClientAccessRule.md index 7c0c19b62d..727903391e 100644 --- a/docs/docs/resources/exchange/EXOClientAccessRule.md +++ b/docs/docs/resources/exchange/EXOClientAccessRule.md @@ -93,3 +93,70 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOClientAccessRule 'ConfigureClientAccessRule' + { + Action = "AllowAccess" + UserRecipientFilter = $null + ExceptAnyOfAuthenticationTypes = @() + ExceptUsernameMatchesAnyOfPatterns = @() + AnyOfAuthenticationTypes = @() + UsernameMatchesAnyOfPatterns = @() + Identity = "Always Allow Remote PowerShell" + Priority = 1 + AnyOfProtocols = @("RemotePowerShell") + Enabled = $False # Updated Property + ExceptAnyOfProtocols = @() + ExceptAnyOfClientIPAddressesOrRanges = @() + AnyOfClientIPAddressesOrRanges = @() + Ensure = "Present" + Credential = $GlobalAdmin + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOClientAccessRule 'ConfigureClientAccessRule' + { + Action = "AllowAccess" + Identity = "Always Allow Remote PowerShell" + Ensure = "Absent" + Credential = $GlobalAdmin + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXODataClassification.md b/docs/docs/resources/exchange/EXODataClassification.md index c91080f60c..1ad5d66ad4 100644 --- a/docs/docs/resources/exchange/EXODataClassification.md +++ b/docs/docs/resources/exchange/EXODataClassification.md @@ -70,3 +70,65 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataClassification 'ConfigureDataClassification' + { + Identity = 'Contoso Confidential' + Name = 'Contoso Confidentiel' + Description = 'Ce message contient des informations confidentielles. Updated' # Updated Property + Locale = 'fr' + IsDefault = $true + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataClassification 'ConfigureDataClassification' + { + Identity = 'Contoso Confidential' + Name = 'Contoso Confidentiel' + Description = 'Ce message contient des informations confidentielles. Updated' # Updated Property + Locale = 'fr' + IsDefault = $true + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXODataEncryptionPolicy.md b/docs/docs/resources/exchange/EXODataEncryptionPolicy.md index d1e2cb3ac3..623f2893c4 100644 --- a/docs/docs/resources/exchange/EXODataEncryptionPolicy.md +++ b/docs/docs/resources/exchange/EXODataEncryptionPolicy.md @@ -70,3 +70,60 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' + { + Identity = 'US Mailboxes' + Name = 'All US Mailboxes' + Description = 'All Mailboxes of users in the US. Updated' # Updated Property + Enabled = $true + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' + { + Identity = 'US Mailboxes' + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXODistributionGroup.md b/docs/docs/resources/exchange/EXODistributionGroup.md index 5fde836832..d690f1b53f 100644 --- a/docs/docs/resources/exchange/EXODistributionGroup.md +++ b/docs/docs/resources/exchange/EXODistributionGroup.md @@ -88,10 +88,11 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credsAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXODistributionGroup 'DemoDG' @@ -102,18 +103,93 @@ Configuration Example DisplayName = "My Demo DG"; Ensure = "Present"; HiddenGroupMembershipEnabled = $True; - ManagedBy = @("john.smith@contoso.com"); + ManagedBy = @("adeleV@$Domain"); MemberDepartRestriction = "Open"; MemberJoinRestriction = "Closed"; - ModeratedBy = @("admin@contoso.com"); + ModeratedBy = @("alexW@$Domain"); ModerationEnabled = $False; Identity = "DemoDG"; Name = "DemoDG"; - OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/contoso.com"; - PrimarySmtpAddress = "demodg@contoso.com"; + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain"; + PrimarySmtpAddress = "demodg@$Domain"; RequireSenderAuthenticationEnabled = $True; SendModerationNotifications = "Always"; - Credential = $credsAdmin + Credential = $Credscredential + } + } +} +``` + +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXODistributionGroup 'DemoDG' + { + Alias = "demodg"; + BccBlocked = $True; # Updated Property + BypassNestedModerationEnabled = $False; + DisplayName = "My Demo DG"; + Ensure = "Present"; + HiddenGroupMembershipEnabled = $True; + ManagedBy = @("adeleV@$Domain"); + MemberDepartRestriction = "Open"; + MemberJoinRestriction = "Closed"; + ModeratedBy = @("alexW@$Domain"); + ModerationEnabled = $False; + Identity = "DemoDG"; + Name = "DemoDG"; + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain"; + PrimarySmtpAddress = "demodg@$Domain"; + RequireSenderAuthenticationEnabled = $True; + SendModerationNotifications = "Always"; + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXODistributionGroup 'DemoDG' + { + DisplayName = "My Demo DG"; + Ensure = "Absent"; + Identity = "DemoDG"; + Name = "DemoDG"; + Credential = $Credscredential } } } diff --git a/docs/docs/resources/exchange/EXODkimSigningConfig.md b/docs/docs/resources/exchange/EXODkimSigningConfig.md index 14020ab62d..c4811b04ff 100644 --- a/docs/docs/resources/exchange/EXODkimSigningConfig.md +++ b/docs/docs/resources/exchange/EXODkimSigningConfig.md @@ -72,3 +72,62 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODkimSigningConfig 'ConfigureDKIMSigning' + { + KeySize = 1024 + Identity = 'contoso.onmicrosoft.com' + HeaderCanonicalization = "Relaxed" + Enabled = $False # Updated Property + BodyCanonicalization = "Relaxed" + AdminDisplayName = "" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXODkimSigningConfig 'ConfigureDKIMSigning' + { + Identity = 'contoso.onmicrosoft.com' + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOEmailAddressPolicy.md b/docs/docs/resources/exchange/EXOEmailAddressPolicy.md index b3330dccbf..282a0c78a6 100644 --- a/docs/docs/resources/exchange/EXOEmailAddressPolicy.md +++ b/docs/docs/resources/exchange/EXOEmailAddressPolicy.md @@ -55,13 +55,14 @@ Configuration Example node localhost { + $Domain = $Credscredential.Username.Split('@')[1] EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { - Name = "Default Policy" - EnabledEmailAddressTemplates = @("SMTP:@contoso.onmicrosoft.com") - EnabledPrimarySMTPAddressTemplate = "@contoso.onmicrosoft.com" + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" ManagedByFilter = "" - Priority = "Lowest" + Priority = 1 Ensure = "Present" Credential = $Credscredential } @@ -69,3 +70,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" + ManagedByFilter = "" + Priority = 2 # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + $Domain = $Credscredential.Username.Split('@')[1] + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOGlobalAddressList.md b/docs/docs/resources/exchange/EXOGlobalAddressList.md index 2f1b602ce2..e414e0b0cb 100644 --- a/docs/docs/resources/exchange/EXOGlobalAddressList.md +++ b/docs/docs/resources/exchange/EXOGlobalAddressList.md @@ -85,3 +85,62 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOGlobalAddressList 'ConfigureGlobalAddressList' + { + Name = "Contoso Human Resources in Washington" + ConditionalCompany = "Contoso" + ConditionalDepartment = "Finances" # Updated Property + ConditionalStateOrProvince = "Washington" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOGlobalAddressList 'ConfigureGlobalAddressList' + { + Name = "Contoso Human Resources in Washington" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOGroupSettings.md b/docs/docs/resources/exchange/EXOGroupSettings.md index 0f5310378c..beb5db2d4f 100644 --- a/docs/docs/resources/exchange/EXOGroupSettings.md +++ b/docs/docs/resources/exchange/EXOGroupSettings.md @@ -96,11 +96,12 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credential + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOGroupSettings 'TestGroup' @@ -111,8 +112,8 @@ Configuration Example AuditLogAgeLimit = "90.00:00:00"; AutoSubscribeNewMembers = $False; CalendarMemberReadOnly = $False; - ConnectorsEnabled = $True; - Credential = $credential; + ConnectorsEnabled = $False; # Updated Property + Credential = $Credscredential; HiddenFromAddressListsEnabled = $True; HiddenFromExchangeClientsEnabled = $True; InformationBarrierMode = "Open"; @@ -121,7 +122,7 @@ Configuration Example MaxSendSize = "35 MB (36,700,160 bytes)"; ModerationEnabled = $False; Notes = "My Notes"; - PrimarySmtpAddress = "TestGroup@contoso.com"; + PrimarySmtpAddress = "TestGroup@$Domain"; RequireSenderAuthenticationEnabled = $True; SubscriptionEnabled = $False; } diff --git a/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md b/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md index a3e585de5f..448373b0b7 100644 --- a/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOHostedConnectionFilterPolicy.md @@ -59,7 +59,7 @@ Configuration Example { EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' { - Identity = "Default" + Identity = "Integration Policy" AdminDisplayName = "" EnableSafeList = $False IPAllowList = @() @@ -72,3 +72,62 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' + { + Identity = "Integration Policy" + AdminDisplayName = "" + EnableSafeList = $True # Updated Property + IPAllowList = @() + IPBlockList = @() + MakeDefault = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' + { + Identity = "Integration Policy" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md b/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md index 6c88da850b..7bbe7e47f3 100644 --- a/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOHostedContentFilterPolicy.md @@ -105,7 +105,7 @@ Configuration Example { EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' { - Identity = "Default" + Identity = "Integration CFP" AddXHeaderValue = "" AdminDisplayName = "" BulkSpamAction = "MoveToJmf" @@ -155,3 +155,99 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' + { + Identity = "Integration CFP" + AddXHeaderValue = "" + AdminDisplayName = "" + BulkSpamAction = "MoveToJmf" + BulkThreshold = 7 + DownloadLink = $True # Updated Property + EnableEndUserSpamNotifications = $False + EnableLanguageBlockList = $False + EnableRegionBlockList = $False + EndUserSpamNotificationCustomSubject = "" + EndUserSpamNotificationFrequency = 3 + EndUserSpamNotificationLanguage = "Default" + HighConfidencePhishAction = "Quarantine" + HighConfidenceSpamAction = "MoveToJmf" + IncreaseScoreWithBizOrInfoUrls = "Off" + IncreaseScoreWithImageLinks = "Off" + IncreaseScoreWithNumericIps = "Off" + IncreaseScoreWithRedirectToOtherPort = "Off" + InlineSafetyTipsEnabled = $True + LanguageBlockList = @() + MakeDefault = $True + MarkAsSpamBulkMail = "On" + MarkAsSpamEmbedTagsInHtml = "Off" + MarkAsSpamEmptyMessages = "Off" + MarkAsSpamFormTagsInHtml = "Off" + MarkAsSpamFramesInHtml = "Off" + MarkAsSpamFromAddressAuthFail = "Off" + MarkAsSpamJavaScriptInHtml = "Off" + MarkAsSpamNdrBackscatter = "Off" + MarkAsSpamObjectTagsInHtml = "Off" + MarkAsSpamSensitiveWordList = "Off" + MarkAsSpamSpfRecordHardFail = "Off" + MarkAsSpamWebBugsInHtml = "Off" + ModifySubjectValue = "" + PhishSpamAction = "MoveToJmf" + PhishZapEnabled = $True + QuarantineRetentionPeriod = 15 + RedirectToRecipients = @() + RegionBlockList = @() + SpamAction = "MoveToJmf" + SpamZapEnabled = $True + TestModeAction = "None" + TestModeBccToRecipients = @() + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' + { + Identity = "Integration CFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOHostedContentFilterRule.md b/docs/docs/resources/exchange/EXOHostedContentFilterRule.md index 97b8ccae2d..132f2f6de7 100644 --- a/docs/docs/resources/exchange/EXOHostedContentFilterRule.md +++ b/docs/docs/resources/exchange/EXOHostedContentFilterRule.md @@ -69,7 +69,7 @@ Configuration Example Comments = "Applies to all users, except when member of HR group" Enabled = $True ExceptIfSentToMemberOf = "Contoso Human Resources" - HostedContentFilterPolicy = "Default" + HostedContentFilterPolicy = "Integration CFP" Ensure = "Present" Credential = $Credscredential } @@ -77,3 +77,64 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' + { + Identity = "Contoso Recipients" + Comments = "Applies to all users, except when member of HR group" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Contoso Human Resources" + HostedContentFilterPolicy = "Integration CFP" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' + { + Identity = "Contoso Recipients" + HostedContentFilterPolicy = "Integration CFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md index e07ebec6d2..74a43374f0 100644 --- a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterPolicy.md @@ -64,7 +64,7 @@ Configuration Example { EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' { - Identity = "Default" + Identity = "Integration SFP" ActionWhenThresholdReached = "BlockUserForToday" AdminDisplayName = "" AutoForwardingMode = "Automatic" @@ -82,3 +82,67 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' + { + Identity = "Integration SFP" + ActionWhenThresholdReached = "BlockUserForToday" + AdminDisplayName = "" + AutoForwardingMode = "Automatic" + BccSuspiciousOutboundAdditionalRecipients = @() + BccSuspiciousOutboundMail = $False + NotifyOutboundSpam = $False + NotifyOutboundSpamRecipients = @() + RecipientLimitExternalPerHour = 0 + RecipientLimitInternalPerHour = 1 # Updated Property + RecipientLimitPerDay = 0 + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' + { + Identity = "Integration SFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md index 46287b09e6..1bd032a9a1 100644 --- a/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md +++ b/docs/docs/resources/exchange/EXOHostedOutboundSpamFilterRule.md @@ -68,8 +68,8 @@ Configuration Example Identity = "Contoso Executives" Comments = "Does not apply to Executives" Enabled = $True - ExceptIfFrom = "Elizabeth Brunner" - HostedOutboundSpamFilterPolicy = "Default" + ExceptIfFrom = "John Smith" + HostedOutboundSpamFilterPolicy = "Integration SFP" Ensure = "Present" Credential = $Credscredential } @@ -77,3 +77,65 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' + { + Identity = "Contoso Executives" + Comments = "Does not apply to Executives" + Enabled = $False # Updated Property + ExceptIfFrom = "John Smith" + HostedOutboundSpamFilterPolicy = "Integration SFP" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' + { + Identity = "Contoso Executives" + Enabled = $False # Updated Property + HostedOutboundSpamFilterPolicy = "Integration SFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOInboundConnector.md b/docs/docs/resources/exchange/EXOInboundConnector.md index cd9a5b7152..1bc2741078 100644 --- a/docs/docs/resources/exchange/EXOInboundConnector.md +++ b/docs/docs/resources/exchange/EXOInboundConnector.md @@ -87,3 +87,68 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOInboundConnector 'ConfigureInboundConnector' + { + Identity = "Contoso Inbound Connector" + CloudServicesMailEnabled = $True + Comment = "Inbound connector for Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $False # Updated Property + RequireTls = $True + SenderDomains = "*.contoso.com" + TlsSenderCertificateName = "contoso.com" + TreatMessagesAsInternal = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOInboundConnector 'ConfigureInboundConnector' + { + Identity = "Contoso Inbound Connector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md b/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md index fd85c9dff3..6bcf11c824 100644 --- a/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md +++ b/docs/docs/resources/exchange/EXOIntraOrganizationConnector.md @@ -69,3 +69,62 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' + { + Identity = "MainCloudConnector" + DiscoveryEndpoint = "https://ExternalDiscovery.Contoso.com" + TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" + Enabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' + { + Identity = "MainCloudConnector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOJournalRule.md b/docs/docs/resources/exchange/EXOJournalRule.md index 3205a2a1a8..548c920cbf 100644 --- a/docs/docs/resources/exchange/EXOJournalRule.md +++ b/docs/docs/resources/exchange/EXOJournalRule.md @@ -53,13 +53,14 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOJournalRule 'CreateJournalRule' { Enabled = $True - JournalEmailAddress = "John.Smith@contoso.com" - Name = "Send to John" + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" RuleScope = "Global" Ensure = "Present" Credential = $Credscredential @@ -68,3 +69,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOJournalRule 'CreateJournalRule' + { + Enabled = $False # Updated Property + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" + RuleScope = "Global" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOJournalRule 'CreateJournalRule' + { + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOMailContact.md b/docs/docs/resources/exchange/EXOMailContact.md index e7cc1779c4..063608382f 100644 --- a/docs/docs/resources/exchange/EXOMailContact.md +++ b/docs/docs/resources/exchange/EXOMailContact.md @@ -85,6 +85,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailContact 'TestMailContact' @@ -100,7 +101,7 @@ Configuration Example ModeratedBy = @() ModerationEnabled = $false Name = 'My Test Contact' - OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$OrganizationName" + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" SendModerationNotifications = 'Always' UsePreferMessageFormat = $true CustomAttribute1 = 'Custom Value 1' @@ -110,3 +111,80 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailContact 'TestMailContact' + { + Alias = 'TestMailContact' + Credential = $Credscredential + DisplayName = 'My Test Contact' + Ensure = 'Present' + ExternalEmailAddress = 'SMTP:test@tailspintoys.com' + MacAttachmentFormat = 'BinHex' + MessageBodyFormat = 'TextAndHtml' + MessageFormat = 'Mime' + ModeratedBy = @() + ModerationEnabled = $false + Name = 'My Test Contact' + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" + SendModerationNotifications = 'Always' + UsePreferMessageFormat = $false # Updated Property + CustomAttribute1 = 'Custom Value 1' + ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailContact 'TestMailContact' + { + Alias = 'TestMailContact' + Credential = $Credscredential + DisplayName = 'My Test Contact' + Ensure = 'Absent' + ExternalEmailAddress = 'SMTP:test@tailspintoys.com' + Name = 'My Test Contact' + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" + SendModerationNotifications = 'Always' + UsePreferMessageFormat = $false # Updated Property + CustomAttribute1 = 'Custom Value 1' + ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOMailTips.md b/docs/docs/resources/exchange/EXOMailTips.md index c567d10c8e..7c46aa87cd 100644 --- a/docs/docs/resources/exchange/EXOMailTips.md +++ b/docs/docs/resources/exchange/EXOMailTips.md @@ -54,11 +54,12 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOMailTips 'OrgWideMailTips' { - Organization = "contoso.com" + Organization = $Domain MailTipsAllTipsEnabled = $True MailTipsGroupMetricsEnabled = $True MailTipsLargeAudienceThreshold = 100 @@ -71,3 +72,64 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailTips 'OrgWideMailTips' + { + Organization = $Domain + MailTipsAllTipsEnabled = $True + MailTipsGroupMetricsEnabled = $False # Updated Property + MailTipsLargeAudienceThreshold = 100 + MailTipsMailboxSourcedTipsEnabled = $True + MailTipsExternalRecipientsTipsEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOMailTips 'OrgWideMailTips' + { + Organization = $Domain + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md b/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md index cc7d993754..0636421297 100644 --- a/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md +++ b/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md @@ -62,15 +62,16 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { - Name = "Default Policy" - EnabledEmailAddressTemplates = @("SMTP:@contoso.onmicrosoft.com") - EnabledPrimarySMTPAddressTemplate = "@contoso.onmicrosoft.com" + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" ManagedByFilter = "" - Priority = "Lowest" + Priority = 1 Ensure = "Present" Credential = $Credscredential } @@ -78,3 +79,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" + ManagedByFilter = "" + Priority = 2 # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md b/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md index 43496b2f91..1f491c98a5 100644 --- a/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md +++ b/docs/docs/resources/exchange/EXOMailboxCalendarFolder.md @@ -64,10 +64,10 @@ Configuration Example Credential = $credsCredential; DetailLevel = "AvailabilityOnly"; Ensure = "Present"; - Identity = "john.smith:\Calendar"; + Identity = "AdeleV:\Calendar"; PublishDateRangeFrom = "ThreeMonths"; PublishDateRangeTo = "ThreeMonths"; - PublishEnabled = $False; + PublishEnabled = $True; # Updated Property SearchableUrlEnabled = $False; } } diff --git a/docs/docs/resources/exchange/EXOMailboxPermission.md b/docs/docs/resources/exchange/EXOMailboxPermission.md index b9c8fb93f8..4fec5d4340 100644 --- a/docs/docs/resources/exchange/EXOMailboxPermission.md +++ b/docs/docs/resources/exchange/EXOMailboxPermission.md @@ -60,9 +60,9 @@ Configuration Example { AccessRights = @("FullAccess","ReadPermission"); Credential = $credsCredential; - Deny = $False; + Deny = $True; # Updated Property Ensure = "Present"; - Identity = "John.Smith"; + Identity = "AdeleV"; InheritanceType = "All"; User = "NT AUTHORITY\SELF"; } diff --git a/docs/docs/resources/exchange/EXOMailboxPlan.md b/docs/docs/resources/exchange/EXOMailboxPlan.md index 523998b6cf..a73658b8ad 100644 --- a/docs/docs/resources/exchange/EXOMailboxPlan.md +++ b/docs/docs/resources/exchange/EXOMailboxPlan.md @@ -62,12 +62,12 @@ Configuration Example EXOMailboxPlan 'ConfigureMailboxPlan' { Ensure = "Present"; - Identity = "ExchangeOnlineEnterprise"; + Identity = "Integration Plan"; IssueWarningQuota = "98 GB (105,226,698,752 bytes)"; MaxReceiveSize = "25 MB (26,214,400 bytes)"; MaxSendSize = "25 MB (26,214,400 bytes)"; ProhibitSendQuota = "99 GB (106,300,440,576 bytes)"; - ProhibitSendReceiveQuota = "100 GB (107,374,182,400 bytes)"; + ProhibitSendReceiveQuota = "15 GB (16,106,127,360 bytes)"; # Updated Property RetainDeletedItemsFor = "14.00:00:00"; RoleAssignmentPolicy = "Default Role Assignment Policy"; Credential = $Credscredential diff --git a/docs/docs/resources/exchange/EXOMailboxSettings.md b/docs/docs/resources/exchange/EXOMailboxSettings.md index 6ecc82e7e6..13089584c9 100644 --- a/docs/docs/resources/exchange/EXOMailboxSettings.md +++ b/docs/docs/resources/exchange/EXOMailboxSettings.md @@ -62,7 +62,7 @@ Configuration Example { DisplayName = 'Ottawa Employees' TimeZone = 'Eastern Standard Time' - Locale = 'fr-CA' + Locale = 'en-US' # Updated Property Ensure = 'Present' Credential = $Credscredential } diff --git a/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md b/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md index 52321a342f..cc1aba6b22 100644 --- a/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md +++ b/docs/docs/resources/exchange/EXOMalwareFilterPolicy.md @@ -71,7 +71,7 @@ Configuration Example { EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' { - Identity = "Default" + Identity = "IntegrationMFP" CustomNotifications = $False EnableExternalSenderAdminNotifications = $False EnableFileFilter = $False @@ -87,3 +87,65 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' + { + Identity = "IntegrationMFP" + CustomNotifications = $False + EnableExternalSenderAdminNotifications = $False + EnableFileFilter = $False + EnableInternalSenderAdminNotifications = $False + FileTypeAction = "Quarantine" + FileTypes = @("ace", "ani", "app", "cab", "docm", "exe", "iso", "jar", "jnlp", "reg", "scr", "vbe", "vbs") + QuarantineTag = "AdminOnlyAccessPolicy" + ZapEnabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' + { + Identity = "IntegrationMFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOMalwareFilterRule.md b/docs/docs/resources/exchange/EXOMalwareFilterRule.md index 48bc0b4615..7b140c38ce 100644 --- a/docs/docs/resources/exchange/EXOMalwareFilterRule.md +++ b/docs/docs/resources/exchange/EXOMalwareFilterRule.md @@ -65,7 +65,7 @@ Configuration Example EXOMalwareFilterRule 'ConfigureMalwareFilterRule' { Identity = "Contoso Recipients" - MalwareFilterPolicy = "Contoso Malware Filter Policy" + MalwareFilterPolicy = "IntegrationMFP" Comments = "Apply the filter to all Contoso users" Enabled = $True RecipientDomainIs = "contoso.com" @@ -76,3 +76,64 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterRule 'ConfigureMalwareFilterRule' + { + Identity = "Contoso Recipients" + MalwareFilterPolicy = "IntegrationMFP" + Comments = "Apply the filter to all Contoso users" + Enabled = $False # Updated Property + RecipientDomainIs = "contoso.com" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMalwareFilterRule 'ConfigureMalwareFilterRule' + { + Identity = "Contoso Recipients" + MalwareFilterPolicy = "IntegrationMFP" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOManagementRole.md b/docs/docs/resources/exchange/EXOManagementRole.md index fb53b84086..410976566f 100644 --- a/docs/docs/resources/exchange/EXOManagementRole.md +++ b/docs/docs/resources/exchange/EXOManagementRole.md @@ -65,3 +65,61 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRole 'ConfigureManagementRole' + { + Name = "MyDisplayName" + Description = "Updated Description" # Updated Property + Parent = "contoso.onmicrosoft.com\MyProfileInformation" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRole 'ConfigureManagementRole' + { + Name = "MyDisplayName" + Description = "Updated Description" # Updated Property + Parent = "contoso.onmicrosoft.com\MyProfileInformation" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOManagementRoleAssignment.md b/docs/docs/resources/exchange/EXOManagementRoleAssignment.md index d868156094..d9ee8fa96c 100644 --- a/docs/docs/resources/exchange/EXOManagementRoleAssignment.md +++ b/docs/docs/resources/exchange/EXOManagementRoleAssignment.md @@ -68,7 +68,65 @@ Configuration Example Ensure = "Present"; Name = "MyManagementRoleAssignment"; Role = "UserApplication"; - User = "John.Smith"; + User = "AdeleV"; + } + } +} +``` + +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRoleAssignment 'AssignManagementRole' + { + Credential = $credsCredential; + Ensure = "Present"; + Name = "MyManagementRoleAssignment"; + Role = "UserApplication"; + User = "AlexW"; # Updated Property + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $credsCredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOManagementRoleAssignment 'AssignManagementRole' + { + Credential = $credsCredential; + Ensure = "Absent"; + Name = "MyManagementRoleAssignment"; + Role = "UserApplication"; + User = "AlexW"; # Updated Property } } } diff --git a/docs/docs/resources/exchange/EXOMessageClassification.md b/docs/docs/resources/exchange/EXOMessageClassification.md index c05dd8eba0..b2b5413847 100644 --- a/docs/docs/resources/exchange/EXOMessageClassification.md +++ b/docs/docs/resources/exchange/EXOMessageClassification.md @@ -77,3 +77,68 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMessageClassification 'ConfigureMessageClassification' + { + Identity = "Contoso Message Classification" + Name = "Contoso Message Classification" + DisplayName = "Contoso Message Classification" + DisplayPrecedence = "Highest" + PermissionMenuVisible = $True + RecipientDescription = "Shown to receipients" + SenderDescription = "Shown to senders" + RetainClassificationEnabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMessageClassification 'ConfigureMessageClassification' + { + Identity = "Contoso Message Classification" + Name = "Contoso Message Classification" + DisplayName = "Contoso Message Classification" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md b/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md index 045e5e9815..9f31767f95 100644 --- a/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md +++ b/docs/docs/resources/exchange/EXOMobileDeviceMailboxPolicy.md @@ -168,3 +168,110 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' + { + Name = "Default" + AllowApplePushNotifications = $True + AllowBluetooth = "Allow" + AllowBrowser = $False # Updated Property + AllowCamera = $True + AllowConsumerEmail = $True + AllowDesktopSync = $True + AllowExternalDeviceManagement = $False + AllowGooglePushNotifications = $True + AllowHTMLEmail = $True + AllowInternetSharing = $True + AllowIrDA = $True + AllowMicrosoftPushNotifications = $True + AllowMobileOTAUpdate = $True + AllowNonProvisionableDevices = $True + AllowPOPIMAPEmail = $True + AllowRemoteDesktop = $True + AllowSimplePassword = $True + AllowSMIMEEncryptionAlgorithmNegotiation = "AllowAnyAlgorithmNegotiation" + AllowSMIMESoftCerts = $True + AllowStorageCard = $True + AllowTextMessaging = $True + AllowUnsignedApplications = $True + AllowUnsignedInstallationPackages = $True + AllowWiFi = $True + AlphanumericPasswordRequired = $False + ApprovedApplicationList = @() + AttachmentsEnabled = $True + DeviceEncryptionEnabled = $False + DevicePolicyRefreshInterval = "Unlimited" + IrmEnabled = $True + IsDefault = $True + MaxAttachmentSize = "Unlimited" + MaxCalendarAgeFilter = "All" + MaxEmailAgeFilter = "All" + MaxEmailBodyTruncationSize = "Unlimited" + MaxEmailHTMLBodyTruncationSize = "Unlimited" + MaxInactivityTimeLock = "Unlimited" + MaxPasswordFailedAttempts = "Unlimited" + MinPasswordComplexCharacters = 1 + PasswordEnabled = $False + PasswordExpiration = "Unlimited" + PasswordHistory = 0 + PasswordRecoveryEnabled = $False + RequireDeviceEncryption = $False + RequireEncryptedSMIMEMessages = $False + RequireEncryptionSMIMEAlgorithm = "TripleDES" + RequireManualSyncWhenRoaming = $False + RequireSignedSMIMEAlgorithm = "SHA1" + RequireSignedSMIMEMessages = $False + RequireStorageCardEncryption = $False + UnapprovedInROMApplicationList = @() + UNCAccessEnabled = $True + WSSAccessEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' + { + Name = "Default" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOMEConfiguration.md b/docs/docs/resources/exchange/EXOOMEConfiguration.md index aec460aca0..b0511a06de 100644 --- a/docs/docs/resources/exchange/EXOOMEConfiguration.md +++ b/docs/docs/resources/exchange/EXOOMEConfiguration.md @@ -80,3 +80,67 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOMEConfiguration 'ConfigureOMEConfiguration' + { + Identity = "Contoso Marketing" + BackgroundColor = "0x00FFFF00" + DisclaimerText = "Encryption security disclaimer." + EmailText = "Encrypted message enclosed." + ExternalMailExpiryInDays = 1 # Updated Property + IntroductionText = "You have received an encypted message" + OTPEnabled = $True + PortalText = "This portal is encrypted." + SocialIdSignIn = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOMEConfiguration 'ConfigureOMEConfiguration' + { + Identity = "Contoso Marketing" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOfflineAddressBook.md b/docs/docs/resources/exchange/EXOOfflineAddressBook.md index d8a60aff62..eb4f547b2a 100644 --- a/docs/docs/resources/exchange/EXOOfflineAddressBook.md +++ b/docs/docs/resources/exchange/EXOOfflineAddressBook.md @@ -59,7 +59,7 @@ Configuration Example { EXOOfflineAddressBook 'ConfigureOfflineAddressBook' { - Name = "Default Offline Address Book" + Name = "Integration Address Book" AddressLists = @('\Offline Global Address List') ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') DiffRetentionPeriod = "30" @@ -71,3 +71,69 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOfflineAddressBook 'ConfigureOfflineAddressBook' + { + Name = "Integration Address Book" + AddressLists = @('\Offline Global Address List') + ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') + DiffRetentionPeriod = "30" + IsDefault = $false # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOfflineAddressBook 'ConfigureOfflineAddressBook' + { + Name = "Integration Address Book" + AddressLists = @('\Offline Global Address List') + ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') + DiffRetentionPeriod = "30" + IsDefault = $true + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOnPremisesOrganization.md b/docs/docs/resources/exchange/EXOOnPremisesOrganization.md index b44a50aabd..9ad83d1e9d 100644 --- a/docs/docs/resources/exchange/EXOOnPremisesOrganization.md +++ b/docs/docs/resources/exchange/EXOOnPremisesOrganization.md @@ -76,3 +76,66 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' + { + Identity = 'Contoso' + Comment = 'Mail for Contoso. Updated' # Updated Property + HybridDomains = 'contoso.com', 'sales.contoso.com' + InboundConnector = 'Inbound to Contoso' + OrganizationGuid = 'a1bc23cb-3456-bcde-abcd-feb363cacc88' + OrganizationName = 'Contoso' + OutboundConnector = 'Outbound to Contoso' + Ensure = 'Present' + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' + { + Identity = 'Contoso' + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOrganizationRelationship.md b/docs/docs/resources/exchange/EXOOrganizationRelationship.md index 119bf16c32..d71c3a49e9 100644 --- a/docs/docs/resources/exchange/EXOOrganizationRelationship.md +++ b/docs/docs/resources/exchange/EXOOrganizationRelationship.md @@ -94,3 +94,72 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOrganizationRelationship 'ConfigureOrganizationRelationship' + { + Name = "Contoso" + ArchiveAccessEnabled = $False # Updated Property + DeliveryReportEnabled = $True + DomainNames = "mail.contoso.com" + Enabled = $True + FreeBusyAccessEnabled = $True + FreeBusyAccessLevel = "AvailabilityOnly" + MailboxMoveEnabled = $True + MailTipsAccessEnabled = $True + MailTipsAccessLevel = "None" + PhotosEnabled = $True + TargetApplicationUri = "mail.contoso.com" + TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOrganizationRelationship 'ConfigureOrganizationRelationship' + { + Name = "Contoso" + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOutboundConnector.md b/docs/docs/resources/exchange/EXOOutboundConnector.md index 3848275f5d..6f0d1388fe 100644 --- a/docs/docs/resources/exchange/EXOOutboundConnector.md +++ b/docs/docs/resources/exchange/EXOOutboundConnector.md @@ -90,3 +90,71 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOutboundConnector 'ConfigureOutboundConnector' + { + Identity = "Contoso Outbound Connector" + AllAcceptedDomains = $True + CloudServicesMailEnabled = $True + Comment = "Outbound connector to Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $False # Updated Property + IsTransportRuleScoped = $True + RecipientDomains = "*.contoso.com" + RouteAllMessagesViaOnPremises = $True + TlsDomain = "*.contoso.com" + TlsSettings = "DomainValidation" + UseMxRecord = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOutboundConnector 'ConfigureOutboundConnector' + { + Identity = "Contoso Outbound Connector" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md b/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md index 82e9c758ad..366476ff0b 100644 --- a/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md +++ b/docs/docs/resources/exchange/EXOOwaMailboxPolicy.md @@ -138,7 +138,7 @@ Configuration Example { EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' { - Name = "OwaMailboxPolicy-Default" + Name = "OwaMailboxPolicy-Integration" ActionForUnknownFileAndMIMETypes = "ForceSave" ActiveSyncIntegrationEnabled = $True AdditionalStorageProvidersAvailable = $True @@ -218,3 +218,129 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' + { + Name = "OwaMailboxPolicy-Integration" + ActionForUnknownFileAndMIMETypes = "ForceSave" + ActiveSyncIntegrationEnabled = $True + AdditionalStorageProvidersAvailable = $True + AllAddressListsEnabled = $True + AllowCopyContactsToDeviceAddressBook = $True + AllowedFileTypes = @(".rpmsg",".xlsx",".xlsm",".xlsb",".tiff",".pptx",".pptm",".ppsx",".ppsm",".docx",".docm",".zip",".xls",".wmv",".wma",".wav",".vsd",".txt",".tif",".rtf",".pub",".ppt",".png",".pdf",".one",".mp3",".jpg",".gif",".doc",".bmp",".avi") + AllowedMimeTypes = @("image/jpeg","image/png","image/gif","image/bmp") + BlockedFileTypes = @(".settingcontent-ms",".printerexport",".appcontent-ms",".appref-ms",".vsmacros",".website",".msh2xml",".msh1xml",".diagcab",".webpnp",".ps2xml",".ps1xml",".mshxml",".gadget",".theme",".psdm1",".mhtml",".cdxml",".xbap",".vhdx",".pyzw",".pssc",".psd1",".psc2",".psc1",".msh2",".msh1",".jnlp",".aspx",".appx",".xnk",".xml",".xll",".wsh",".wsf",".wsc",".wsb",".vsw",".vst",".vss",".vhd",".vbs",".vbp",".vbe",".url",".udl",".tmp",".shs",".shb",".sct",".scr",".scf",".reg",".pyz",".pyw",".pyo",".pyc",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".msu",".mst",".msp",".msi",".msh",".msc",".mht",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".mcf",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".jar",".its",".isp",".ins",".inf",".htc",".hta",".hpj",".hlp",".grp",".fxp",".exe",".der",".csh",".crt",".cpl",".com",".cnt",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".apk",".adp",".ade",".ws",".vb",".py",".pl",".js") + BlockedMimeTypes = @("application/x-javascript","application/javascript","application/msaccess","x-internet-signup","text/javascript","application/xml","application/prg","application/hta","text/scriplet","text/xml") + ClassicAttachmentsEnabled = $True + ConditionalAccessPolicy = "Off" + DefaultTheme = "" + DirectFileAccessOnPrivateComputersEnabled = $True + DirectFileAccessOnPublicComputersEnabled = $False # Updated Property + DisplayPhotosEnabled = $True + ExplicitLogonEnabled = $True + ExternalImageProxyEnabled = $True + ForceSaveAttachmentFilteringEnabled = $False + ForceSaveFileTypes = @(".vsmacros",".ps2xml",".ps1xml",".mshxml",".gadget",".psc2",".psc1",".aspx",".wsh",".wsf",".wsc",".vsw",".vst",".vss",".vbs",".vbe",".url",".tmp",".swf",".spl",".shs",".shb",".sct",".scr",".scf",".reg",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".mst",".msp",".msi",".msh",".msc",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".its",".isp",".ins",".inf",".hta",".hlp",".fxp",".exe",".dir",".dcr",".csh",".crt",".cpl",".com",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".adp",".ade",".ws",".vb",".js") + ForceSaveMimeTypes = @("Application/x-shockwave-flash","Application/octet-stream","Application/futuresplash","Application/x-director") + ForceWacViewingFirstOnPrivateComputers = $False + ForceWacViewingFirstOnPublicComputers = $False + FreCardsEnabled = $True + GlobalAddressListEnabled = $True + GroupCreationEnabled = $True + InstantMessagingEnabled = $True + InstantMessagingType = "Ocs" + InterestingCalendarsEnabled = $True + IRMEnabled = $True + IsDefault = $True + JournalEnabled = $True + LocalEventsEnabled = $False + LogonAndErrorLanguage = 0 + NotesEnabled = $True + NpsSurveysEnabled = $True + OnSendAddinsEnabled = $False + OrganizationEnabled = $True + OutboundCharset = "AutoDetect" + OutlookBetaToggleEnabled = $True + OWALightEnabled = $True + PersonalAccountCalendarsEnabled = $True + PhoneticSupportEnabled = $False + PlacesEnabled = $True + PremiumClientEnabled = $True + PrintWithoutDownloadEnabled = $True + PublicFoldersEnabled = $True + RecoverDeletedItemsEnabled = $True + ReferenceAttachmentsEnabled = $True + RemindersAndNotificationsEnabled = $True + ReportJunkEmailEnabled = $True + RulesEnabled = $True + SatisfactionEnabled = $True + SaveAttachmentsToCloudEnabled = $True + SearchFoldersEnabled = $True + SetPhotoEnabled = $True + SetPhotoURL = "" + SignaturesEnabled = $True + SkipCreateUnifiedGroupCustomSharepointClassification = $True + TeamSnapCalendarsEnabled = $True + TextMessagingEnabled = $True + ThemeSelectionEnabled = $True + UMIntegrationEnabled = $True + UseGB18030 = $False + UseISO885915 = $False + UserVoiceEnabled = $True + WacEditingEnabled = $True + WacExternalServicesEnabled = $True + WacOMEXEnabled = $False + WacViewingOnPrivateComputersEnabled = $True + WacViewingOnPublicComputersEnabled = $True + WeatherEnabled = $True + WebPartsFrameOptionsType = "SameOrigin" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' + { + Name = "OwaMailboxPolicy-Integration" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOPartnerApplication.md b/docs/docs/resources/exchange/EXOPartnerApplication.md index 9df7e5cb13..3370ee3f64 100644 --- a/docs/docs/resources/exchange/EXOPartnerApplication.md +++ b/docs/docs/resources/exchange/EXOPartnerApplication.md @@ -70,3 +70,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPartnerApplication 'ConfigurePartnerApplication' + { + Name = "HRApp" + ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" + AccountType = "OrganizationalAccount" + Enabled = $False # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPartnerApplication 'ConfigurePartnerApplication' + { + Name = "HRApp" + ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOPlace.md b/docs/docs/resources/exchange/EXOPlace.md index 8adb95904f..13d3b4eba4 100644 --- a/docs/docs/resources/exchange/EXOPlace.md +++ b/docs/docs/resources/exchange/EXOPlace.md @@ -67,11 +67,12 @@ Configuration Example ( [Parameter(Mandatory = $true)] [PSCredential] - $credential + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOPlace 'TestPlace' @@ -79,10 +80,10 @@ Configuration Example AudioDeviceName = "MyAudioDevice"; Capacity = 15; #Drift City = ""; - Credential = $credential + Credential = $Credscredential DisplayDeviceName = "DisplayDeviceName"; Ensure = 'Present' - Identity = "MyRoom@$contoso.com"; + Identity = "MyRoom@$Domain"; IsWheelChairAccessible = $True; MTREnabled = $False; ParentType = "None"; @@ -94,3 +95,75 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOPlace 'TestPlace' + { + AudioDeviceName = "MyAudioDevice"; + Capacity = 16; # Updated Property + City = ""; + Credential = $Credscredential + DisplayDeviceName = "DisplayDeviceName"; + Ensure = 'Present' + Identity = "MyRoom@$Domain"; + IsWheelChairAccessible = $True; + MTREnabled = $False; + ParentType = "None"; + Phone = "555-555-5555"; + Tags = @("Tag1", "Tag2"); + VideoDeviceName = "VideoDevice"; + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOPlace 'TestPlace' + { + AudioDeviceName = "MyAudioDevice"; + Credential = $Credscredential + DisplayDeviceName = "DisplayDeviceName"; + Ensure = 'Absent' + Identity = "MyRoom@$Domain"; + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOPolicyTipConfig.md b/docs/docs/resources/exchange/EXOPolicyTipConfig.md index 160459e6ed..ec09fb4a3a 100644 --- a/docs/docs/resources/exchange/EXOPolicyTipConfig.md +++ b/docs/docs/resources/exchange/EXOPolicyTipConfig.md @@ -64,3 +64,61 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPolicyTipConfig 'ConfigurePolicyTipConfig' + { + Name = "en\NotifyOnly" + Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOPolicyTipConfig 'ConfigurePolicyTipConfig' + { + Name = "en\NotifyOnly" + Value = "This message contains content that is restricted by Contoso company policy. Updated" # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOQuarantinePolicy.md b/docs/docs/resources/exchange/EXOQuarantinePolicy.md index 99fece786c..86ee5e75f5 100644 --- a/docs/docs/resources/exchange/EXOQuarantinePolicy.md +++ b/docs/docs/resources/exchange/EXOQuarantinePolicy.md @@ -62,13 +62,14 @@ Configuration Example $OrganizationName = $Credscredential.UserName.Split('@')[1] Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOQuarantinePolicy 'ConfigureQuarantinePolicy' { EndUserQuarantinePermissionsValue = 87; ESNEnabled = $False; - Identity = "$OrganizationName\DefaultFullAccessPolicy"; + Identity = "$Domain\DefaultFullAccessPolicy"; Ensure = "Present" Credential = $Credscredential } @@ -76,3 +77,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + $OrganizationName = $Credscredential.UserName.Split('@')[1] + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOQuarantinePolicy 'ConfigureQuarantinePolicy' + { + EndUserQuarantinePermissionsValue = 87; + ESNEnabled = $True; # Updated Property + Identity = "$Domain\DefaultFullAccessPolicy"; + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + $OrganizationName = $Credscredential.UserName.Split('@')[1] + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOQuarantinePolicy 'ConfigureQuarantinePolicy' + { + Identity = "$Domain\DefaultFullAccessPolicy"; + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXORemoteDomain.md b/docs/docs/resources/exchange/EXORemoteDomain.md index 755413c10d..d8f1373597 100644 --- a/docs/docs/resources/exchange/EXORemoteDomain.md +++ b/docs/docs/resources/exchange/EXORemoteDomain.md @@ -75,7 +75,7 @@ Configuration Example { EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 { - Identity = "Default" + Identity = "Integration" AllowedOOFType = "External" AutoForwardEnabled = $True AutoReplyEnabled = $True @@ -102,3 +102,76 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 + { + Identity = "Integration" + AllowedOOFType = "External" + AutoForwardEnabled = $True + AutoReplyEnabled = $False # Updated Property + ByteEncoderTypeFor7BitCharsets = "Undefined" + CharacterSet = "iso-8859-1" + ContentType = "MimeHtmlText" + DeliveryReportEnabled = $True + DisplaySenderName = $True + DomainName = "*" + IsInternal = $False + LineWrapSize = "Unlimited" + MeetingForwardNotificationEnabled = $False + Name = "Default" + NonMimeCharacterSet = "iso-8859-1" + PreferredInternetCodePageForShiftJis = "Undefined" + TargetDeliveryDomain = $False + TrustedMailInboundEnabled = $False + TrustedMailOutboundEnabled = $False + UseSimpleDisplayName = $False + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORemoteDomain 583b0b70-b45d-401f-98a6-0e7fa8434946 + { + Identity = "Integration" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md b/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md index 5b74d5ddd4..1b483a8b3b 100644 --- a/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md +++ b/docs/docs/resources/exchange/EXORoleAssignmentPolicy.md @@ -56,7 +56,7 @@ Configuration Example { EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' { - Name = "Default Role Assignment Policy" + Name = "Integration Policy" Description = "This policy grants end users the permission to set their options in Outlook on the web and perform other self-administration tasks." IsDefault = $True Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") @@ -67,3 +67,62 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' + { + Name = "Integration Policy" + Description = "This policy grants end users the permission to set their options in Outlook on the web and perform other self-administration tasks." + IsDefault = $False # Updated Property + Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' + { + Name = "Integration Policy" + IsDefault = $False # Updated Property + Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXORoleGroup.md b/docs/docs/resources/exchange/EXORoleGroup.md index be6730c14f..ad98192862 100644 --- a/docs/docs/resources/exchange/EXORoleGroup.md +++ b/docs/docs/resources/exchange/EXORoleGroup.md @@ -68,3 +68,64 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleGroup 'ConfigureRoleGroup' + { + Name = "Contoso Role Group" + Description = "Address Lists Role for Exchange Administrators. Updated" # Updated Property + Members = @("Exchange Administrator") + Roles = @("Address Lists") + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXORoleGroup 'ConfigureRoleGroup' + { + Name = "Contoso Role Group" + Members = @("Exchange Administrator") + Roles = @("Address Lists") + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md b/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md index 0de9f31932..1d70d28297 100644 --- a/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md +++ b/docs/docs/resources/exchange/EXOSafeAttachmentPolicy.md @@ -58,6 +58,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' @@ -65,7 +66,7 @@ Configuration Example Identity = "Marketing Block Attachments" Enable = $True Redirect = $True - RedirectAddress = "admin@contoso.com" + RedirectAddress = "admin@$Domain" Ensure = "Present" Credential = $Credscredential } @@ -73,3 +74,65 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' + { + Identity = "Marketing Block Attachments" + Enable = $False # Updated Property + Redirect = $True + RedirectAddress = "admin@$Domain" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' + { + Identity = "Marketing Block Attachments" + Enable = $False # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSafeAttachmentRule.md b/docs/docs/resources/exchange/EXOSafeAttachmentRule.md index 7cfae505f8..9e4b1e9a27 100644 --- a/docs/docs/resources/exchange/EXOSafeAttachmentRule.md +++ b/docs/docs/resources/exchange/EXOSafeAttachmentRule.md @@ -68,7 +68,7 @@ Configuration Example Comments = "Applies to Research Department, except managers" Enabled = $True ExceptIfSentToMemberOf = "Research Department Managers" - SafeAttachmentPolicy = "Research Block Attachments" + SafeAttachmentPolicy = "Marketing Block Attachments" SentToMemberOf = "Research Department" Ensure = "Present" Credential = $Credscredential @@ -77,3 +77,68 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' + { + Identity = "Research Department Attachment Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeAttachmentPolicy = "Marketing Block Attachments" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' + { + Identity = "Research Department Attachment Rule" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeAttachmentPolicy = "Marketing Block Attachments" + SentToMemberOf = "Research Department" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSafeLinksPolicy.md b/docs/docs/resources/exchange/EXOSafeLinksPolicy.md index 914ef01f5f..55102a0a47 100644 --- a/docs/docs/resources/exchange/EXOSafeLinksPolicy.md +++ b/docs/docs/resources/exchange/EXOSafeLinksPolicy.md @@ -84,3 +84,66 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' + { + Identity = 'Marketing Block URL' + AdminDisplayName = 'Marketing Block URL' + CustomNotificationText = 'Blocked URLs for Marketing' + DeliverMessageAfterScan = $True + EnableOrganizationBranding = $False # Updated Property + EnableSafeLinksForTeams = $True + ScanUrls = $True + UseTranslatedNotificationText = $True + Ensure = 'Present' + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' + { + Identity = 'Marketing Block URL' + Ensure = 'Absent' + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSafeLinksRule.md b/docs/docs/resources/exchange/EXOSafeLinksRule.md index be69811e5d..7f6a684f88 100644 --- a/docs/docs/resources/exchange/EXOSafeLinksRule.md +++ b/docs/docs/resources/exchange/EXOSafeLinksRule.md @@ -68,7 +68,7 @@ Configuration Example Comments = "Applies to Research Department, except managers" Enabled = $True ExceptIfSentToMemberOf = "Research Department Managers" - SafeLinksPolicy = "Research Block URL" + SafeLinksPolicy = "Marketing Block URL" SentToMemberOf = "Research Department" Ensure = "Present" Credential = $Credscredential @@ -77,3 +77,67 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksRule 'ConfigureSafeLinksRule' + { + Identity = "Research Department URL Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + ExceptIfSentToMemberOf = "Research Department Managers" + SafeLinksPolicy = "Marketing Block URL" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSafeLinksRule 'ConfigureSafeLinksRule' + { + Identity = "Research Department URL Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $False # Updated Property + SafeLinksPolicy = "Marketing Block URL" + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSharedMailbox.md b/docs/docs/resources/exchange/EXOSharedMailbox.md index 45d3beccb1..75901ef81e 100644 --- a/docs/docs/resources/exchange/EXOSharedMailbox.md +++ b/docs/docs/resources/exchange/EXOSharedMailbox.md @@ -52,13 +52,14 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOSharedMailbox 'SharedMailbox' { DisplayName = "Test" - PrimarySMTPAddress = "Test@O365DSC1.onmicrosoft.com" - EmailAddresses = @("Joufflu@o365dsc1.onmicrosoft.com", "Gilles@O365dsc1.onmicrosoft.com") + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain") Ensure = "Present" Credential = $Credscredential } @@ -66,3 +67,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSharedMailbox 'SharedMailbox' + { + DisplayName = "Test" + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain", "AlexW@$Domain") # Updated Property + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + $Domain = $Credscredential.Username.Split('@')[1] + node localhost + { + EXOSharedMailbox 'SharedMailbox' + { + DisplayName = "Test" + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain", "AlexW@$Domain") # Updated Property + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOSharingPolicy.md b/docs/docs/resources/exchange/EXOSharingPolicy.md index c5b35441ef..a3ec9a4b1f 100644 --- a/docs/docs/resources/exchange/EXOSharingPolicy.md +++ b/docs/docs/resources/exchange/EXOSharingPolicy.md @@ -56,7 +56,7 @@ Configuration Example { EXOSharingPolicy 'ConfigureSharingPolicy' { - Name = "Default Sharing Policy" + Name = "Integration Sharing Policy" Default = $True Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") Enabled = $True @@ -67,3 +67,63 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSharingPolicy 'ConfigureSharingPolicy' + { + Name = "Integration Sharing Policy" + Default = $False # Updated Property + Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOSharingPolicy 'ConfigureSharingPolicy' + { + Name = "Integration Sharing Policy" + Default = $False # Updated Property + Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + diff --git a/docs/docs/resources/exchange/EXOTransportRule.md b/docs/docs/resources/exchange/EXOTransportRule.md index 9d1aeb353d..ddba9efe92 100644 --- a/docs/docs/resources/exchange/EXOTransportRule.md +++ b/docs/docs/resources/exchange/EXOTransportRule.md @@ -235,3 +235,66 @@ Configuration Example } ``` +### Example 2 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOTransportRule 'ConfigureTransportRule' + { + Name = "Ethical Wall - Sales and Brokerage Departments" + BetweenMemberOf1 = "Sales Department" + BetweenMemberOf2 = "Brokerage Department" + ExceptIfFrom = "Tony Smith","Pilar Ackerman" + ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" + RejectMessageReasonText = "Updated" # Updated Property + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } +} +``` + +### Example 3 + +This example is used to test new resources and showcase the usage of new resources being worked on. +It is not meant to use as a production baseline. + +```powershell +Configuration Example +{ + param + ( + [Parameter(Mandatory = $true)] + [PSCredential] + $Credscredential + ) + Import-DscResource -ModuleName Microsoft365DSC + + node localhost + { + EXOTransportRule 'ConfigureTransportRule' + { + Name = "Ethical Wall - Sales and Brokerage Departments" + Enabled = $True + Ensure = "Absent" + Credential = $Credscredential + } + } +} +``` + From e97aea6ce5d67ff67e0b4e3c26f515cd2d500b0e Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Mon, 22 Jan 2024 20:18:56 +0000 Subject: [PATCH 053/122] Updated {Create} EXO Integration Tests --- .../M365DSCIntegration.EXO.Create.Tests.ps1 | 844 ++++++++++++++++++ 1 file changed, 844 insertions(+) create mode 100644 Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 new file mode 100644 index 0000000000..de7a56d24d --- /dev/null +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -0,0 +1,844 @@ + param + ( + [Parameter()] + [System.Management.Automation.PSCredential] + $Credential + ) + + Configuration Master + { + param + ( + [Parameter(Mandatory = $true)] + [System.Management.Automation.PSCredential] + $Credscredential + ) + + Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] + Node Localhost + { + EXOAcceptedDomain 'O365DSCDomain' + { + Identity = 'contoso.com' + DomainType = "Authoritative" + OutboundOnly = $false + Ensure = "Present" + Credential = $Credscredential + } + EXOActiveSyncDeviceAccessRule 'ConfigureActiveSyncDeviceAccessRule' + { + Identity = "ContosoPhone(DeviceOS)" + Characteristic = "DeviceOS" + QueryString = "iOS 6.1 10B145" + AccessLevel = "Allow" + Ensure = "Present" + Credential = $Credscredential + } + EXOAddressBookPolicy 'ConfigureAddressBookPolicy' + { + Name = "All Fabrikam ABP" + AddressLists = "\All Fabrikam","\All Fabrikam Mailboxes","\All Fabrikam DLs","\All Fabrikam Contacts" + RoomList = "\All Fabrikam-Rooms" + OfflineAddressBook = "\Fabrikam-All-OAB" + GlobalAddressList = "\All Fabrikam" + Ensure = "Present" + Credential = $Credscredential + } + EXOAddressList 'HRUsersAddressList' + { + Name = "HR Users" + ConditionalCompany = "Contoso" + ConditionalDepartment = "HR" + ConditionalStateOrProvince = "US" + IncludedRecipients = "AllRecipients" + Ensure = "Present" + Credential = $Credscredential + } + EXOAntiPhishPolicy 'ConfigureAntiphishPolicy' + { + Identity = "Our Rule" + MakeDefault = $null + PhishThresholdLevel = 1 + EnableTargetedDomainsProtection = $null + Enabled = $null + TargetedDomainsToProtect = $null + EnableSimilarUsersSafetyTips = $null + ExcludedDomains = $null + TargetedDomainActionRecipients = $null + EnableMailboxIntelligence = $null + EnableSimilarDomainsSafetyTips = $null + AdminDisplayName = "" + AuthenticationFailAction = "MoveToJmf" + TargetedUserProtectionAction = "NoAction" + TargetedUsersToProtect = $null + EnableTargetedUserProtection = $null + ExcludedSenders = $null + EnableOrganizationDomainsProtection = $null + EnableUnusualCharactersSafetyTips = $null + TargetedUserActionRecipients = $null + Ensure = "Present" + Credential = $Credscredential + } + EXOAntiPhishRule 'ConfigureAntiPhishRule' + { + Identity = "Test Rule" + ExceptIfSentToMemberOf = $null + ExceptIfSentTo = $null + SentTo = $null + ExceptIfRecipientDomainIs = $null + Comments = $null + AntiPhishPolicy = "Our Rule" + RecipientDomainIs = $null + Enabled = $True + SentToMemberOf = @("msteams_bb15d4@contoso.onmicrosoft.com") + Priority = 1 + Ensure = "Present" + Credential = $Credscredential + } + EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' + { + Identity = "Global" + AccessRight = "DenyAccess" + AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") + PolicyScopeGroupId = "Engineering Staff" + Description = "Engineering Group Policy" + Ensure = "Present" + Credential = $Credscredential + } + EXOAuthenticationPolicy 'ConfigureAuthenticationPolicy' + { + Identity = "Block Basic Auth" + AllowBasicAuthActiveSync = $False + AllowBasicAuthAutodiscover = $False + AllowBasicAuthImap = $False + AllowBasicAuthMapi = $False + AllowBasicAuthOfflineAddressBook = $False + AllowBasicAuthOutlookService = $False + AllowBasicAuthPop = $False + AllowBasicAuthPowerShell = $False + AllowBasicAuthReportingWebServices = $False + AllowBasicAuthRpc = $False + AllowBasicAuthSmtp = $False + AllowBasicAuthWebServices = $False + Ensure = "Present" + Credential = $Credscredential + } + EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' + { + UserName = "AdeleV" + AuthenticationPolicyName = "Block Basic Auth" + Ensure = "Present" + Credential = $EXOAdmin + } + EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' + { + Identity = 'Contoso.com' + AccessMethod = 'OrgWideFB' + ForestName = 'example.contoso.com' + TargetAutodiscoverEpr = 'https://contoso.com/autodiscover/autodiscover.xml' + Ensure = 'Present' + Credential = $Credscredential + } + EXOAvailabilityConfig 'ConfigureAvailabilityConfig' + { + OrgWideAccount = "adelev@$Domain" + Ensure = "Present" + Credential = $Credscredential + } + EXOClientAccessRule 'ConfigureClientAccessRule' + { + Action = "AllowAccess" + UserRecipientFilter = $null + ExceptAnyOfAuthenticationTypes = @() + ExceptUsernameMatchesAnyOfPatterns = @() + AnyOfAuthenticationTypes = @() + UsernameMatchesAnyOfPatterns = @() + Identity = "Always Allow Remote PowerShell" + Priority = 1 + AnyOfProtocols = @("RemotePowerShell") + Enabled = $True + ExceptAnyOfProtocols = @() + ExceptAnyOfClientIPAddressesOrRanges = @() + AnyOfClientIPAddressesOrRanges = @() + Ensure = "Present" + Credential = $GlobalAdmin + } + EXODataClassification 'ConfigureDataClassification' + { + Identity = 'Contoso Confidential' + Name = 'Contoso Confidentiel' + Description = 'Ce message contient des informations confidentielles.' + Locale = 'fr' + IsDefault = $true + Ensure = "Present" + Credential = $Credscredential + } + EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' + { + Identity = 'US Mailboxes' + Name = 'All US Mailboxes' + Description = 'All Mailboxes of users in the US' + Enabled = $true + Ensure = "Present" + Credential = $Credscredential + } + EXODistributionGroup 'DemoDG' + { + Alias = "demodg"; + BccBlocked = $False; + BypassNestedModerationEnabled = $False; + DisplayName = "My Demo DG"; + Ensure = "Present"; + HiddenGroupMembershipEnabled = $True; + ManagedBy = @("adeleV@$Domain"); + MemberDepartRestriction = "Open"; + MemberJoinRestriction = "Closed"; + ModeratedBy = @("alexW@$Domain"); + ModerationEnabled = $False; + Identity = "DemoDG"; + Name = "DemoDG"; + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain"; + PrimarySmtpAddress = "demodg@$Domain"; + RequireSenderAuthenticationEnabled = $True; + SendModerationNotifications = "Always"; + Credential = $Credscredential + } + EXODkimSigningConfig 'ConfigureDKIMSigning' + { + KeySize = 1024 + Identity = 'contoso.onmicrosoft.com' + HeaderCanonicalization = "Relaxed" + Enabled = $True + BodyCanonicalization = "Relaxed" + AdminDisplayName = "" + Ensure = "Present" + Credential = $Credscredential + } + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" + ManagedByFilter = "" + Priority = 1 + Ensure = "Present" + Credential = $Credscredential + } + EXOGlobalAddressList 'ConfigureGlobalAddressList' + { + Name = "Contoso Human Resources in Washington" + ConditionalCompany = "Contoso" + ConditionalDepartment = "Human Resources" + ConditionalStateOrProvince = "Washington" + Ensure = "Present" + Credential = $Credscredential + } + EXOHostedConnectionFilterPolicy 'ConfigureHostedConnectionFilterPolicy' + { + Identity = "Integration Policy" + AdminDisplayName = "" + EnableSafeList = $False + IPAllowList = @() + IPBlockList = @() + MakeDefault = $False + Ensure = "Present" + Credential = $Credscredential + } + EXOHostedContentFilterPolicy 'ConfigureHostedContentFilterPolicy' + { + Identity = "Integration CFP" + AddXHeaderValue = "" + AdminDisplayName = "" + BulkSpamAction = "MoveToJmf" + BulkThreshold = 7 + DownloadLink = $False + EnableEndUserSpamNotifications = $False + EnableLanguageBlockList = $False + EnableRegionBlockList = $False + EndUserSpamNotificationCustomSubject = "" + EndUserSpamNotificationFrequency = 3 + EndUserSpamNotificationLanguage = "Default" + HighConfidencePhishAction = "Quarantine" + HighConfidenceSpamAction = "MoveToJmf" + IncreaseScoreWithBizOrInfoUrls = "Off" + IncreaseScoreWithImageLinks = "Off" + IncreaseScoreWithNumericIps = "Off" + IncreaseScoreWithRedirectToOtherPort = "Off" + InlineSafetyTipsEnabled = $True + LanguageBlockList = @() + MakeDefault = $True + MarkAsSpamBulkMail = "On" + MarkAsSpamEmbedTagsInHtml = "Off" + MarkAsSpamEmptyMessages = "Off" + MarkAsSpamFormTagsInHtml = "Off" + MarkAsSpamFramesInHtml = "Off" + MarkAsSpamFromAddressAuthFail = "Off" + MarkAsSpamJavaScriptInHtml = "Off" + MarkAsSpamNdrBackscatter = "Off" + MarkAsSpamObjectTagsInHtml = "Off" + MarkAsSpamSensitiveWordList = "Off" + MarkAsSpamSpfRecordHardFail = "Off" + MarkAsSpamWebBugsInHtml = "Off" + ModifySubjectValue = "" + PhishSpamAction = "MoveToJmf" + PhishZapEnabled = $True + QuarantineRetentionPeriod = 15 + RedirectToRecipients = @() + RegionBlockList = @() + SpamAction = "MoveToJmf" + SpamZapEnabled = $True + TestModeAction = "None" + TestModeBccToRecipients = @() + Ensure = "Present" + Credential = $Credscredential + } + EXOHostedContentFilterRule 'ConfigureHostedContentFilterRule' + { + Identity = "Contoso Recipients" + Comments = "Applies to all users, except when member of HR group" + Enabled = $True + ExceptIfSentToMemberOf = "Contoso Human Resources" + HostedContentFilterPolicy = "Integration CFP" + Ensure = "Present" + Credential = $Credscredential + } + EXOHostedOutboundSpamFilterPolicy 'HostedOutboundSpamFilterPolicy' + { + Identity = "Integration SFP" + ActionWhenThresholdReached = "BlockUserForToday" + AdminDisplayName = "" + AutoForwardingMode = "Automatic" + BccSuspiciousOutboundAdditionalRecipients = @() + BccSuspiciousOutboundMail = $False + NotifyOutboundSpam = $False + NotifyOutboundSpamRecipients = @() + RecipientLimitExternalPerHour = 0 + RecipientLimitInternalPerHour = 0 + RecipientLimitPerDay = 0 + Ensure = "Present" + Credential = $Credscredential + } + EXOHostedOutboundSpamFilterRule 'ConfigureHostedOutboundSpamFilterRule' + { + Identity = "Contoso Executives" + Comments = "Does not apply to Executives" + Enabled = $True + ExceptIfFrom = "John Smith" + HostedOutboundSpamFilterPolicy = "Integration SFP" + Ensure = "Present" + Credential = $Credscredential + } + EXOInboundConnector 'ConfigureInboundConnector' + { + Identity = "Contoso Inbound Connector" + CloudServicesMailEnabled = $True + Comment = "Inbound connector for Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $True + RequireTls = $True + SenderDomains = "*.contoso.com" + TlsSenderCertificateName = "contoso.com" + TreatMessagesAsInternal = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOIntraOrganizationConnector 'ConfigureIntraOrganizationConnector' + { + Identity = "MainCloudConnector" + DiscoveryEndpoint = "https://ExternalDiscovery.Contoso.com" + TargetAddressDomains = "Cloud1.contoso.com","Cloud2.contoso.com" + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOJournalRule 'CreateJournalRule' + { + Enabled = $True + JournalEmailAddress = "AdeleV@$Domain" + Name = "Send to Adele" + RuleScope = "Global" + Ensure = "Present" + Credential = $Credscredential + } + EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + { + Name = "Integration Policy" + EnabledEmailAddressTemplates = @("SMTP:@$Domain") + EnabledPrimarySMTPAddressTemplate = "@$Domain" + ManagedByFilter = "" + Priority = 1 + Ensure = "Present" + Credential = $Credscredential + } + EXOMailContact 'TestMailContact' + { + Alias = 'TestMailContact' + Credential = $Credscredential + DisplayName = 'My Test Contact' + Ensure = 'Present' + ExternalEmailAddress = 'SMTP:test@tailspintoys.com' + MacAttachmentFormat = 'BinHex' + MessageBodyFormat = 'TextAndHtml' + MessageFormat = 'Mime' + ModeratedBy = @() + ModerationEnabled = $false + Name = 'My Test Contact' + OrganizationalUnit = "nampr03a010.prod.outlook.com/Microsoft Exchange Hosted Organizations/$Domain" + SendModerationNotifications = 'Always' + UsePreferMessageFormat = $true + CustomAttribute1 = 'Custom Value 1' + ExtensionCustomAttribute5 = 'Extension Custom Value 1', 'Extension Custom Value 2' + } + EXOMailTips 'OrgWideMailTips' + { + Organization = $Domain + MailTipsAllTipsEnabled = $True + MailTipsGroupMetricsEnabled = $True + MailTipsLargeAudienceThreshold = 100 + MailTipsMailboxSourcedTipsEnabled = $True + MailTipsExternalRecipientsTipsEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOMalwareFilterPolicy 'ConfigureMalwareFilterPolicy' + { + Identity = "IntegrationMFP" + CustomNotifications = $False + EnableExternalSenderAdminNotifications = $False + EnableFileFilter = $False + EnableInternalSenderAdminNotifications = $False + FileTypeAction = "Quarantine" + FileTypes = @("ace", "ani", "app", "cab", "docm", "exe", "iso", "jar", "jnlp", "reg", "scr", "vbe", "vbs") + QuarantineTag = "AdminOnlyAccessPolicy" + ZapEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOMalwareFilterRule 'ConfigureMalwareFilterRule' + { + Identity = "Contoso Recipients" + MalwareFilterPolicy = "IntegrationMFP" + Comments = "Apply the filter to all Contoso users" + Enabled = $True + RecipientDomainIs = "contoso.com" + Ensure = "Present" + Credential = $Credscredential + } + EXOManagementRole 'ConfigureManagementRole' + { + Name = "MyDisplayName" + Description = "" + Parent = "contoso.onmicrosoft.com\MyProfileInformation" + Ensure = "Present" + Credential = $Credscredential + } + EXOManagementRoleAssignment 'AssignManagementRole' + { + Credential = $credsCredential; + Ensure = "Present"; + Name = "MyManagementRoleAssignment"; + Role = "UserApplication"; + User = "AdeleV"; + } + EXOMessageClassification 'ConfigureMessageClassification' + { + Identity = "Contoso Message Classification" + Name = "Contoso Message Classification" + DisplayName = "Contoso Message Classification" + DisplayPrecedence = "Highest" + PermissionMenuVisible = $True + RecipientDescription = "Shown to receipients" + SenderDescription = "Shown to senders" + RetainClassificationEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOMobileDeviceMailboxPolicy 'ConfigureMobileDeviceMailboxPolicy' + { + Name = "Default" + AllowApplePushNotifications = $True + AllowBluetooth = "Allow" + AllowBrowser = $True + AllowCamera = $True + AllowConsumerEmail = $True + AllowDesktopSync = $True + AllowExternalDeviceManagement = $False + AllowGooglePushNotifications = $True + AllowHTMLEmail = $True + AllowInternetSharing = $True + AllowIrDA = $True + AllowMicrosoftPushNotifications = $True + AllowMobileOTAUpdate = $True + AllowNonProvisionableDevices = $True + AllowPOPIMAPEmail = $True + AllowRemoteDesktop = $True + AllowSimplePassword = $True + AllowSMIMEEncryptionAlgorithmNegotiation = "AllowAnyAlgorithmNegotiation" + AllowSMIMESoftCerts = $True + AllowStorageCard = $True + AllowTextMessaging = $True + AllowUnsignedApplications = $True + AllowUnsignedInstallationPackages = $True + AllowWiFi = $True + AlphanumericPasswordRequired = $False + ApprovedApplicationList = @() + AttachmentsEnabled = $True + DeviceEncryptionEnabled = $False + DevicePolicyRefreshInterval = "Unlimited" + IrmEnabled = $True + IsDefault = $True + MaxAttachmentSize = "Unlimited" + MaxCalendarAgeFilter = "All" + MaxEmailAgeFilter = "All" + MaxEmailBodyTruncationSize = "Unlimited" + MaxEmailHTMLBodyTruncationSize = "Unlimited" + MaxInactivityTimeLock = "Unlimited" + MaxPasswordFailedAttempts = "Unlimited" + MinPasswordComplexCharacters = 1 + PasswordEnabled = $False + PasswordExpiration = "Unlimited" + PasswordHistory = 0 + PasswordRecoveryEnabled = $False + RequireDeviceEncryption = $False + RequireEncryptedSMIMEMessages = $False + RequireEncryptionSMIMEAlgorithm = "TripleDES" + RequireManualSyncWhenRoaming = $False + RequireSignedSMIMEAlgorithm = "SHA1" + RequireSignedSMIMEMessages = $False + RequireStorageCardEncryption = $False + UnapprovedInROMApplicationList = @() + UNCAccessEnabled = $True + WSSAccessEnabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOOfflineAddressBook 'ConfigureOfflineAddressBook' + { + Name = "Integration Address Book" + AddressLists = @('\Offline Global Address List') + ConfiguredAttributes = @('OfficeLocation, ANR', 'ProxyAddresses, ANR', 'PhoneticGivenName, ANR', 'GivenName, ANR', 'PhoneticSurname, ANR', 'Surname, ANR', 'Account, ANR', 'PhoneticDisplayName, ANR', 'UserInformationDisplayName, ANR', 'ExternalMemberCount, Value', 'TotalMemberCount, Value', 'ModerationEnabled, Value', 'DelivContLength, Value', 'MailTipTranslations, Value', 'ObjectGuid, Value', 'IsOrganizational, Value', 'HabSeniorityIndex, Value', 'DisplayTypeEx, Value', 'SimpleDisplayNameAnsi, Value', 'HomeMdbA, Value', 'Certificate, Value', 'UserSMimeCertificate, Value', 'UserCertificate, Value', 'Comment, Value', 'PagerTelephoneNumber, Value', 'AssistantTelephoneNumber, Value', 'MobileTelephoneNumber, Value', 'PrimaryFaxNumber, Value', 'Home2TelephoneNumberMv, Value', 'Business2TelephoneNumberMv, Value', 'HomeTelephoneNumber, Value', 'TargetAddress, Value', 'PhoneticDepartmentName, Value', 'DepartmentName, Value', 'Assistant, Value', 'PhoneticCompanyName, Value', 'CompanyName, Value', 'Title, Value', 'Country, Value', 'PostalCode, Value', 'StateOrProvince, Value', 'Locality, Value', 'StreetAddress, Value', 'Initials, Value', 'BusinessTelephoneNumber, Value', 'SendRichInfo, Value', 'ObjectType, Value', 'DisplayType, Value', 'RejectMessagesFromDLMembers, Indicator', 'AcceptMessagesOnlyFromDLMembers, Indicator', 'RejectMessagesFrom, Indicator', 'AcceptMessagesOnlyFrom, Indicator', 'UmSpokenName, Indicator', 'ThumbnailPhoto, Indicator') + DiffRetentionPeriod = "30" + IsDefault = $true + Ensure = "Present" + Credential = $Credscredential + } + EXOOMEConfiguration 'ConfigureOMEConfiguration' + { + Identity = "Contoso Marketing" + BackgroundColor = "0x00FFFF00" + DisclaimerText = "Encryption security disclaimer." + EmailText = "Encrypted message enclosed." + ExternalMailExpiryInDays = 0 + IntroductionText = "You have received an encypted message" + OTPEnabled = $True + PortalText = "This portal is encrypted." + SocialIdSignIn = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOOnPremisesOrganization 'ConfigureOnPremisesOrganization' + { + Identity = 'Contoso' + Comment = 'Mail for Contoso' + HybridDomains = 'contoso.com', 'sales.contoso.com' + InboundConnector = 'Inbound to Contoso' + OrganizationGuid = 'a1bc23cb-3456-bcde-abcd-feb363cacc88' + OrganizationName = 'Contoso' + OutboundConnector = 'Outbound to Contoso' + Ensure = 'Present' + Credential = $Credscredential + } + EXOOrganizationRelationship 'ConfigureOrganizationRelationship' + { + Name = "Contoso" + ArchiveAccessEnabled = $True + DeliveryReportEnabled = $True + DomainNames = "mail.contoso.com" + Enabled = $True + FreeBusyAccessEnabled = $True + FreeBusyAccessLevel = "AvailabilityOnly" + MailboxMoveEnabled = $True + MailTipsAccessEnabled = $True + MailTipsAccessLevel = "None" + PhotosEnabled = $True + TargetApplicationUri = "mail.contoso.com" + TargetAutodiscoverEpr = "https://mail.contoso.com/autodiscover/autodiscover.svc/wssecurity" + Ensure = "Present" + Credential = $Credscredential + } + EXOOutboundConnector 'ConfigureOutboundConnector' + { + Identity = "Contoso Outbound Connector" + AllAcceptedDomains = $True + CloudServicesMailEnabled = $True + Comment = "Outbound connector to Contoso" + ConnectorSource = "Default" + ConnectorType = "OnPremises" + Enabled = $True + IsTransportRuleScoped = $True + RecipientDomains = "*.contoso.com" + RouteAllMessagesViaOnPremises = $True + TlsDomain = "*.contoso.com" + TlsSettings = "DomainValidation" + UseMxRecord = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOOwaMailboxPolicy 'ConfigureOwaMailboxPolicy' + { + Name = "OwaMailboxPolicy-Integration" + ActionForUnknownFileAndMIMETypes = "ForceSave" + ActiveSyncIntegrationEnabled = $True + AdditionalStorageProvidersAvailable = $True + AllAddressListsEnabled = $True + AllowCopyContactsToDeviceAddressBook = $True + AllowedFileTypes = @(".rpmsg",".xlsx",".xlsm",".xlsb",".tiff",".pptx",".pptm",".ppsx",".ppsm",".docx",".docm",".zip",".xls",".wmv",".wma",".wav",".vsd",".txt",".tif",".rtf",".pub",".ppt",".png",".pdf",".one",".mp3",".jpg",".gif",".doc",".bmp",".avi") + AllowedMimeTypes = @("image/jpeg","image/png","image/gif","image/bmp") + BlockedFileTypes = @(".settingcontent-ms",".printerexport",".appcontent-ms",".appref-ms",".vsmacros",".website",".msh2xml",".msh1xml",".diagcab",".webpnp",".ps2xml",".ps1xml",".mshxml",".gadget",".theme",".psdm1",".mhtml",".cdxml",".xbap",".vhdx",".pyzw",".pssc",".psd1",".psc2",".psc1",".msh2",".msh1",".jnlp",".aspx",".appx",".xnk",".xml",".xll",".wsh",".wsf",".wsc",".wsb",".vsw",".vst",".vss",".vhd",".vbs",".vbp",".vbe",".url",".udl",".tmp",".shs",".shb",".sct",".scr",".scf",".reg",".pyz",".pyw",".pyo",".pyc",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".msu",".mst",".msp",".msi",".msh",".msc",".mht",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".mcf",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".jar",".its",".isp",".ins",".inf",".htc",".hta",".hpj",".hlp",".grp",".fxp",".exe",".der",".csh",".crt",".cpl",".com",".cnt",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".apk",".adp",".ade",".ws",".vb",".py",".pl",".js") + BlockedMimeTypes = @("application/x-javascript","application/javascript","application/msaccess","x-internet-signup","text/javascript","application/xml","application/prg","application/hta","text/scriplet","text/xml") + ClassicAttachmentsEnabled = $True + ConditionalAccessPolicy = "Off" + DefaultTheme = "" + DirectFileAccessOnPrivateComputersEnabled = $True + DirectFileAccessOnPublicComputersEnabled = $True + DisplayPhotosEnabled = $True + ExplicitLogonEnabled = $True + ExternalImageProxyEnabled = $True + ForceSaveAttachmentFilteringEnabled = $False + ForceSaveFileTypes = @(".vsmacros",".ps2xml",".ps1xml",".mshxml",".gadget",".psc2",".psc1",".aspx",".wsh",".wsf",".wsc",".vsw",".vst",".vss",".vbs",".vbe",".url",".tmp",".swf",".spl",".shs",".shb",".sct",".scr",".scf",".reg",".pst",".ps2",".ps1",".prg",".prf",".plg",".pif",".pcd",".ops",".mst",".msp",".msi",".msh",".msc",".mdz",".mdw",".mdt",".mde",".mdb",".mda",".maw",".mav",".mau",".mat",".mas",".mar",".maq",".mam",".mag",".maf",".mad",".lnk",".ksh",".jse",".its",".isp",".ins",".inf",".hta",".hlp",".fxp",".exe",".dir",".dcr",".csh",".crt",".cpl",".com",".cmd",".chm",".cer",".bat",".bas",".asx",".asp",".app",".adp",".ade",".ws",".vb",".js") + ForceSaveMimeTypes = @("Application/x-shockwave-flash","Application/octet-stream","Application/futuresplash","Application/x-director") + ForceWacViewingFirstOnPrivateComputers = $False + ForceWacViewingFirstOnPublicComputers = $False + FreCardsEnabled = $True + GlobalAddressListEnabled = $True + GroupCreationEnabled = $True + InstantMessagingEnabled = $True + InstantMessagingType = "Ocs" + InterestingCalendarsEnabled = $True + IRMEnabled = $True + IsDefault = $True + JournalEnabled = $True + LocalEventsEnabled = $False + LogonAndErrorLanguage = 0 + NotesEnabled = $True + NpsSurveysEnabled = $True + OnSendAddinsEnabled = $False + OrganizationEnabled = $True + OutboundCharset = "AutoDetect" + OutlookBetaToggleEnabled = $True + OWALightEnabled = $True + PersonalAccountCalendarsEnabled = $True + PhoneticSupportEnabled = $False + PlacesEnabled = $True + PremiumClientEnabled = $True + PrintWithoutDownloadEnabled = $True + PublicFoldersEnabled = $True + RecoverDeletedItemsEnabled = $True + ReferenceAttachmentsEnabled = $True + RemindersAndNotificationsEnabled = $True + ReportJunkEmailEnabled = $True + RulesEnabled = $True + SatisfactionEnabled = $True + SaveAttachmentsToCloudEnabled = $True + SearchFoldersEnabled = $True + SetPhotoEnabled = $True + SetPhotoURL = "" + SignaturesEnabled = $True + SkipCreateUnifiedGroupCustomSharepointClassification = $True + TeamSnapCalendarsEnabled = $True + TextMessagingEnabled = $True + ThemeSelectionEnabled = $True + UMIntegrationEnabled = $True + UseGB18030 = $False + UseISO885915 = $False + UserVoiceEnabled = $True + WacEditingEnabled = $True + WacExternalServicesEnabled = $True + WacOMEXEnabled = $False + WacViewingOnPrivateComputersEnabled = $True + WacViewingOnPublicComputersEnabled = $True + WeatherEnabled = $True + WebPartsFrameOptionsType = "SameOrigin" + Ensure = "Present" + Credential = $Credscredential + } + EXOPartnerApplication 'ConfigurePartnerApplication' + { + Name = "HRApp" + ApplicationIdentifier = "00000006-0000-0dd1-ac00-000000000000" + AccountType = "OrganizationalAccount" + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOPlace 'TestPlace' + { + AudioDeviceName = "MyAudioDevice"; + Capacity = 15; #Drift + City = ""; + Credential = $Credscredential + DisplayDeviceName = "DisplayDeviceName"; + Ensure = 'Present' + Identity = "MyRoom@$Domain"; + IsWheelChairAccessible = $True; + MTREnabled = $False; + ParentType = "None"; + Phone = "555-555-5555"; + Tags = @("Tag1", "Tag2"); + VideoDeviceName = "VideoDevice"; + } + EXOPolicyTipConfig 'ConfigurePolicyTipConfig' + { + Name = "en\NotifyOnly" + Value = "This message contains content that is restricted by Contoso company policy." + Ensure = "Present" + Credential = $Credscredential + } + EXOQuarantinePolicy 'ConfigureQuarantinePolicy' + { + EndUserQuarantinePermissionsValue = 87; + ESNEnabled = $False; + Identity = "$Domain\DefaultFullAccessPolicy"; + Ensure = "Present" + Credential = $Credscredential + } + EXORemoteDomain '583b0b70-b45d-401f-98a6-0e7fa8434946' + { + Identity = "Integration" + AllowedOOFType = "External" + AutoForwardEnabled = $True + AutoReplyEnabled = $True + ByteEncoderTypeFor7BitCharsets = "Undefined" + CharacterSet = "iso-8859-1" + ContentType = "MimeHtmlText" + DeliveryReportEnabled = $True + DisplaySenderName = $True + DomainName = "*" + IsInternal = $False + LineWrapSize = "Unlimited" + MeetingForwardNotificationEnabled = $False + Name = "Default" + NonMimeCharacterSet = "iso-8859-1" + PreferredInternetCodePageForShiftJis = "Undefined" + TargetDeliveryDomain = $False + TrustedMailInboundEnabled = $False + TrustedMailOutboundEnabled = $False + UseSimpleDisplayName = $False + Ensure = "Present" + Credential = $Credscredential + } + EXORoleAssignmentPolicy 'ConfigureRoleAssignmentPolicy' + { + Name = "Integration Policy" + Description = "This policy grants end users the permission to set their options in Outlook on the web and perform other self-administration tasks." + IsDefault = $True + Roles = @("My Marketplace Apps","MyVoiceMail","MyDistributionGroups","MyRetentionPolicies","MyContactInformation","MyBaseOptions","MyTextMessaging","MyDistributionGroupMembership","MyProfileInformation","My Custom Apps","My ReadWriteMailbox Apps") + Ensure = "Present" + Credential = $Credscredential + } + EXORoleGroup 'ConfigureRoleGroup' + { + Name = "Contoso Role Group" + Description = "Address Lists Role for Exchange Administrators" + Members = @("Exchange Administrator") + Roles = @("Address Lists") + Ensure = "Present" + Credential = $Credscredential + } + EXOSafeAttachmentPolicy 'ConfigureSafeAttachmentPolicy' + { + Identity = "Marketing Block Attachments" + Enable = $True + Redirect = $True + RedirectAddress = "admin@$Domain" + Ensure = "Present" + Credential = $Credscredential + } + EXOSafeAttachmentRule 'ConfigureSafeAttachmentRule' + { + Identity = "Research Department Attachment Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $True + ExceptIfSentToMemberOf = "Research Department Managers" + SafeAttachmentPolicy = "Marketing Block Attachments" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + EXOSafeLinksPolicy 'ConfigureSafeLinksPolicy' + { + Identity = 'Marketing Block URL' + AdminDisplayName = 'Marketing Block URL' + CustomNotificationText = 'Blocked URLs for Marketing' + DeliverMessageAfterScan = $True + EnableOrganizationBranding = $True + EnableSafeLinksForTeams = $True + ScanUrls = $True + UseTranslatedNotificationText = $True + Ensure = 'Present' + Credential = $Credscredential + } + EXOSafeLinksRule 'ConfigureSafeLinksRule' + { + Identity = "Research Department URL Rule" + Comments = "Applies to Research Department, except managers" + Enabled = $True + ExceptIfSentToMemberOf = "Research Department Managers" + SafeLinksPolicy = "Marketing Block URL" + SentToMemberOf = "Research Department" + Ensure = "Present" + Credential = $Credscredential + } + EXOSharedMailbox 'SharedMailbox' + { + DisplayName = "Test" + PrimarySMTPAddress = "Test@$Domain" + EmailAddresses = @("AdeleV@$Domain") + Ensure = "Present" + Credential = $Credscredential + } + EXOSharingPolicy 'ConfigureSharingPolicy' + { + Name = "Integration Sharing Policy" + Default = $True + Domains = @("Anonymous:CalendarSharingFreeBusyReviewer", "*:CalendarSharingFreeBusySimple") + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + EXOTransportRule 'ConfigureTransportRule' + { + Name = "Ethical Wall - Sales and Brokerage Departments" + BetweenMemberOf1 = "Sales Department" + BetweenMemberOf2 = "Brokerage Department" + ExceptIfFrom = "Tony Smith","Pilar Ackerman" + ExceptIfSubjectContainsWords = "Press Release","Corporate Communication" + RejectMessageReasonText = "Messages sent between the Sales and Brokerage departments are strictly prohibited." + Enabled = $True + Ensure = "Present" + Credential = $Credscredential + } + } + } + + $ConfigurationData = @{ + AllNodes = @( + @{ + NodeName = "Localhost" + PSDSCAllowPlaintextPassword = $true + } + ) + } + + # Compile and deploy configuration + try + { + Master -ConfigurationData $ConfigurationData -Credscredential $Credential + Start-DscConfiguration Master -Wait -Force -Verbose -ErrorAction Stop + } + catch + { + throw $_ + } From 32c3e6c529620cd70b380eac7b0b1447424c0cea Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Mon, 22 Jan 2024 15:26:41 -0500 Subject: [PATCH 054/122] Fixes Integration for EXO --- .../EXOEmailAddressPolicy/1-Create.ps1 | 2 +- .../EXOEmailAddressPolicy/2-Update.ps1 | 2 +- .../1-Create.ps1 | 24 ++++++++++++------- .../2-Update.ps1 | 24 ++++++++++++------- .../3-Remove.ps1 | 8 +++---- 5 files changed, 38 insertions(+), 22 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 index 4d15d6d523..5f61c9a780 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/1-Create.ps1 @@ -12,9 +12,9 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 index 4be41679af..59a62ba67e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOEmailAddressPolicy/2-Update.ps1 @@ -12,9 +12,9 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-Create.ps1 index 5f61c9a780..50536da857 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-Create.ps1 @@ -15,15 +15,23 @@ Configuration Example $Domain = $Credscredential.Username.Split('@')[1] node localhost { - EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + EXOMailboxAutoReplyConfiguration "EXOMailboxAutoReplyConfiguration" { - Name = "Integration Policy" - EnabledEmailAddressTemplates = @("SMTP:@$Domain") - EnabledPrimarySMTPAddressTemplate = "@$Domain" - ManagedByFilter = "" - Priority = 1 - Ensure = "Present" - Credential = $Credscredential + AutoDeclineFutureRequestsWhenOOF = $False; + AutoReplyState = "Disabled"; + CreateOOFEvent = $False; + Credential = $Credscredential; + DeclineAllEventsForScheduledOOF = $False; + DeclineEventsForScheduledOOF = $False; + DeclineMeetingMessage = ""; + EndTime = "1/23/2024 3:00:00 PM"; + Ensure = "Present"; + ExternalAudience = "All"; + ExternalMessage = ""; + Identity = "AdeleV@$Domain"; + InternalMessage = ""; + OOFEventSubject = ""; + StartTime = "1/22/2024 3:00:00 PM"; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 index 59a62ba67e..3fb5e18e6a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/2-Update.ps1 @@ -15,15 +15,23 @@ Configuration Example $Domain = $Credscredential.Username.Split('@')[1] node localhost { - EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + EXOMailboxAutoReplyConfiguration "EXOMailboxAutoReplyConfiguration" { - Name = "Integration Policy" - EnabledEmailAddressTemplates = @("SMTP:@$Domain") - EnabledPrimarySMTPAddressTemplate = "@$Domain" - ManagedByFilter = "" - Priority = 2 # Updated Property - Ensure = "Present" - Credential = $Credscredential + AutoDeclineFutureRequestsWhenOOF = $False; + AutoReplyState = "Disabled"; + CreateOOFEvent = $False; + Credential = $Credscredential; + DeclineAllEventsForScheduledOOF = $False; + DeclineEventsForScheduledOOF = $True; # Updated Property + DeclineMeetingMessage = ""; + EndTime = "1/23/2024 3:00:00 PM"; + Ensure = "Present"; + ExternalAudience = "All"; + ExternalMessage = ""; + Identity = "AdeleV@$Domain"; + InternalMessage = ""; + OOFEventSubject = ""; + StartTime = "1/22/2024 3:00:00 PM"; } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 index 2df42cc7a3..dc4f716854 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 @@ -15,11 +15,11 @@ Configuration Example $Domain = $Credscredential.Username.Split('@')[1] node localhost { - EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + EXOMailboxAutoReplyConfiguration "EXOMailboxAutoReplyConfiguration" { - Name = "Integration Policy" - Ensure = "Absent" - Credential = $Credscredential + Credential = $Credscredential; + Ensure = "Absent"; + Identity = "AdeleV@$Domain"; } } } From 9fa74e3785a937f06b2581ae43855c0bc3042e11 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Mon, 22 Jan 2024 15:35:18 -0500 Subject: [PATCH 055/122] Fix --- .../1-Create.ps1 | 37 ------------------- .../3-Remove.ps1 | 25 ------------- 2 files changed, 62 deletions(-) delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-Create.ps1 deleted file mode 100644 index 50536da857..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/1-Create.ps1 +++ /dev/null @@ -1,37 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - $Domain = $Credscredential.Username.Split('@')[1] - node localhost - { - EXOMailboxAutoReplyConfiguration "EXOMailboxAutoReplyConfiguration" - { - AutoDeclineFutureRequestsWhenOOF = $False; - AutoReplyState = "Disabled"; - CreateOOFEvent = $False; - Credential = $Credscredential; - DeclineAllEventsForScheduledOOF = $False; - DeclineEventsForScheduledOOF = $False; - DeclineMeetingMessage = ""; - EndTime = "1/23/2024 3:00:00 PM"; - Ensure = "Present"; - ExternalAudience = "All"; - ExternalMessage = ""; - Identity = "AdeleV@$Domain"; - InternalMessage = ""; - OOFEventSubject = ""; - StartTime = "1/22/2024 3:00:00 PM"; - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 deleted file mode 100644 index dc4f716854..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOMailboxAutoReplyConfiguration/3-Remove.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - $Domain = $Credscredential.Username.Split('@')[1] - node localhost - { - EXOMailboxAutoReplyConfiguration "EXOMailboxAutoReplyConfiguration" - { - Credential = $Credscredential; - Ensure = "Absent"; - Identity = "AdeleV@$Domain"; - } - } -} From 6d8cf06c94e45e1cc2a729815168dccc5c04d912 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Mon, 22 Jan 2024 20:35:55 +0000 Subject: [PATCH 056/122] Fix condition when resource is absent --- CHANGELOG.md | 7 +++++-- .../MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e573868f44..7a2afca107 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ * Remove the logic path to create a new instance in favor of the update flow. * AADConditionalAccessPolicy * Fix issue when not all parameters are specified - FIXES [[#4202](https://github.com/microsoft/Microsoft365DSC/issues/4202)] + FIXES [#4202](https://github.com/microsoft/Microsoft365DSC/issues/4202) * AADCrossTenantAccessPolicy * Removed the ability to specify a value of Absent for the Ensure property. * AADCrossTenantAccessPolicyCOnfigurationDefault @@ -31,6 +31,9 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. +* TeamsCortanaPolicy + * Fix condition in Test-TargetResource when resouce is absent + FIXES [#4208](https://github.com/microsoft/Microsoft365DSC/issues/4208) # 1.24.117.1 @@ -52,7 +55,7 @@ * Removed the ability to specify a value of Absent for the Ensure property. * EXOAntiPhishPolicy * Add support for HonorDmarcPolicy parameter - FIXES [[#4138](https://github.com/microsoft/Microsoft365DSC/issues/4138)] + FIXES [#4138](https://github.com/microsoft/Microsoft365DSC/issues/4138) * IntuneDeviceConfigurationPolicyMacOS * Fix CIM instances comparison in Test-TargetResource and export CompliantAppsList with the correct type diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 index 25f2da7bb7..b14fb3e016 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 @@ -259,7 +259,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false From 1df08fb501f4fb92f41d82d597f28d1c10adcb25 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Mon, 22 Jan 2024 20:45:20 +0000 Subject: [PATCH 057/122] Fix condition when resource is absent --- CHANGELOG.md | 3 +++ .../MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 920fb6117b..50ba7d5c25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. +* TeamsCallParkPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4210](https://github.com/microsoft/Microsoft365DSC/issues/4210) * DEPENDENCIES * Updated Microsoft.Graph dependencies to version 2.12.0. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 index 25f2da7bb7..b14fb3e016 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 @@ -259,7 +259,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false From 95cf58e1c5be8b70e93ccabf356541ce6bc9c8fa Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Mon, 22 Jan 2024 20:46:40 +0000 Subject: [PATCH 058/122] Fix typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a2afca107..e58e67b96a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,7 @@ * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. * TeamsCortanaPolicy - * Fix condition in Test-TargetResource when resouce is absent + * Fix condition in Test-TargetResource when resource is absent FIXES [#4208](https://github.com/microsoft/Microsoft365DSC/issues/4208) # 1.24.117.1 From d66ddbef72b086bb73c8bc9498e65a6daae2fc93 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Mon, 22 Jan 2024 20:48:04 +0000 Subject: [PATCH 059/122] Updated Resources and Cmdlet documentation pages --- .../exchange/EXOEmailAddressPolicy.md | 4 +- .../EXOMailboxAutoReplyConfiguration.md | 84 ++++--------------- 2 files changed, 18 insertions(+), 70 deletions(-) diff --git a/docs/docs/resources/exchange/EXOEmailAddressPolicy.md b/docs/docs/resources/exchange/EXOEmailAddressPolicy.md index 282a0c78a6..5fe66dd421 100644 --- a/docs/docs/resources/exchange/EXOEmailAddressPolicy.md +++ b/docs/docs/resources/exchange/EXOEmailAddressPolicy.md @@ -53,9 +53,9 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" @@ -85,9 +85,9 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { - $Domain = $Credscredential.Username.Split('@')[1] EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' { Name = "Integration Policy" diff --git a/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md b/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md index 0636421297..5357252f4a 100644 --- a/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md +++ b/docs/docs/resources/exchange/EXOMailboxAutoReplyConfiguration.md @@ -65,75 +65,23 @@ Configuration Example $Domain = $Credscredential.Username.Split('@')[1] node localhost { - EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' + EXOMailboxAutoReplyConfiguration "EXOMailboxAutoReplyConfiguration" { - Name = "Integration Policy" - EnabledEmailAddressTemplates = @("SMTP:@$Domain") - EnabledPrimarySMTPAddressTemplate = "@$Domain" - ManagedByFilter = "" - Priority = 1 - Ensure = "Present" - Credential = $Credscredential - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - $Domain = $Credscredential.Username.Split('@')[1] - node localhost - { - EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' - { - Name = "Integration Policy" - EnabledEmailAddressTemplates = @("SMTP:@$Domain") - EnabledPrimarySMTPAddressTemplate = "@$Domain" - ManagedByFilter = "" - Priority = 2 # Updated Property - Ensure = "Present" - Credential = $Credscredential - } - } -} -``` - -### Example 3 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - $Domain = $Credscredential.Username.Split('@')[1] - node localhost - { - EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' - { - Name = "Integration Policy" - Ensure = "Absent" - Credential = $Credscredential + AutoDeclineFutureRequestsWhenOOF = $False; + AutoReplyState = "Disabled"; + CreateOOFEvent = $False; + Credential = $Credscredential; + DeclineAllEventsForScheduledOOF = $False; + DeclineEventsForScheduledOOF = $True; # Updated Property + DeclineMeetingMessage = ""; + EndTime = "1/23/2024 3:00:00 PM"; + Ensure = "Present"; + ExternalAudience = "All"; + ExternalMessage = ""; + Identity = "AdeleV@$Domain"; + InternalMessage = ""; + OOFEventSubject = ""; + StartTime = "1/22/2024 3:00:00 PM"; } } } From 0d6058da107da1454392adf96babad385983ea9f Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Mon, 22 Jan 2024 20:50:25 +0000 Subject: [PATCH 060/122] Updated {Create} EXO Integration Tests --- .../M365DSCIntegration.EXO.Create.Tests.ps1 | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 index de7a56d24d..1e0a60778c 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -362,16 +362,6 @@ Ensure = "Present" Credential = $Credscredential } - EXOEmailAddressPolicy 'ConfigureEmailAddressPolicy' - { - Name = "Integration Policy" - EnabledEmailAddressTemplates = @("SMTP:@$Domain") - EnabledPrimarySMTPAddressTemplate = "@$Domain" - ManagedByFilter = "" - Priority = 1 - Ensure = "Present" - Credential = $Credscredential - } EXOMailContact 'TestMailContact' { Alias = 'TestMailContact' From 31e3d6a2e67454afe37c75ed18d92c7c40538dd6 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Mon, 22 Jan 2024 15:51:45 -0500 Subject: [PATCH 061/122] Fixes --- .../Examples/Resources/EXOAcceptedDomain/1-Create.ps1 | 2 +- .../Examples/Resources/EXOAcceptedDomain/2-Update.ps1 | 2 +- .../EXOAcceptedDomain/{2-Update copy.ps1 => 3-Remove.ps1} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/{2-Update copy.ps1 => 3-Remove.ps1} (91%) diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 index 5ffbc721c7..fb87f8e87e 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'contoso.com' + Identity = 'o365dsc.onmicrosoft.com' DomainType = "Authoritative" OutboundOnly = $false Ensure = "Present" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 index e5d456d7a5..34b5d6dd8d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'contoso.com' + Identity = 'o365dsc.onmicrosoft.com' DomainType = "Authoritative" OutboundOnly = $true # Updated Property Ensure = "Present" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update copy.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 similarity index 91% rename from Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update copy.ps1 rename to Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 index 302a9945f2..77aebdb862 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update copy.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'contoso.com' + Identity = 'o365dsc.onmicrosoft.com' DomainType = "Authoritative" Ensure = "Absent" Credential = $Credscredential From 0d915aaf84383bebe792fc2be18062e74006e98d Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Mon, 22 Jan 2024 20:52:41 +0000 Subject: [PATCH 062/122] Fix condition when resource is absent --- CHANGELOG.md | 3 +++ .../MSFT_TeamsComplianceRecordingPolicy.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 920fb6117b..764955d86f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. +* TeamsComplianceRecordingPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4212](https://github.com/microsoft/Microsoft365DSC/issues/4212) * DEPENDENCIES * Updated Microsoft.Graph dependencies to version 2.12.0. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 index 896913588e..abe0d6a964 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 @@ -304,7 +304,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false From 05a25e5560440fd77eae08d3b5f0e1e22529bdb5 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Mon, 22 Jan 2024 20:53:02 +0000 Subject: [PATCH 063/122] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/exchange/EXOAcceptedDomain.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/docs/resources/exchange/EXOAcceptedDomain.md b/docs/docs/resources/exchange/EXOAcceptedDomain.md index 088c787201..47f107987e 100644 --- a/docs/docs/resources/exchange/EXOAcceptedDomain.md +++ b/docs/docs/resources/exchange/EXOAcceptedDomain.md @@ -56,7 +56,7 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'contoso.com' + Identity = 'o365dsc.onmicrosoft.com' DomainType = "Authoritative" OutboundOnly = $false Ensure = "Present" @@ -85,9 +85,10 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'contoso.com' + Identity = 'o365dsc.onmicrosoft.com' DomainType = "Authoritative" - Ensure = "Absent" + OutboundOnly = $true # Updated Property + Ensure = "Present" Credential = $Credscredential } } @@ -113,10 +114,9 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'contoso.com' + Identity = 'o365dsc.onmicrosoft.com' DomainType = "Authoritative" - OutboundOnly = $true # Updated Property - Ensure = "Present" + Ensure = "Absent" Credential = $Credscredential } } From 308972d823fbfd184d77383f9c36ab0084dfe208 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Mon, 22 Jan 2024 20:55:14 +0000 Subject: [PATCH 064/122] 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 1e0a60778c..e2ce3aa0b9 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -20,7 +20,7 @@ { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'contoso.com' + Identity = 'o365dsc.onmicrosoft.com' DomainType = "Authoritative" OutboundOnly = $false Ensure = "Present" From 88984bd4bbfe01bed0138a13fec5efec9ef5e8ac Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Mon, 22 Jan 2024 20:56:56 +0000 Subject: [PATCH 065/122] Fix condition when resource is absent --- CHANGELOG.md | 3 +++ .../MSFT_TeamsAudioConferencingPolicy.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 920fb6117b..b0483ada45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. +* TeamsAudioConferencingPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4215](https://github.com/microsoft/Microsoft365DSC/issues/4215) * DEPENDENCIES * Updated Microsoft.Graph dependencies to version 2.12.0. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 index 733363ea31..3d3ef592a3 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 @@ -256,7 +256,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false From 22f904ba29ee3af7e4968f8585818321a7cb1973 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Mon, 22 Jan 2024 16:14:26 -0500 Subject: [PATCH 066/122] Fixes --- .../Examples/Resources/EXOAcceptedDomain/1-Create.ps1 | 3 ++- .../Examples/Resources/EXOAcceptedDomain/2-Update.ps1 | 2 +- .../Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 index fb87f8e87e..7c28c8da3a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/1-Create.ps1 @@ -12,11 +12,12 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'o365dsc.onmicrosoft.com' + Identity = $Domain DomainType = "Authoritative" OutboundOnly = $false Ensure = "Present" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 index 34b5d6dd8d..189b0d02d1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/2-Update.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'o365dsc.onmicrosoft.com' + Identity = $Domain DomainType = "Authoritative" OutboundOnly = $true # Updated Property Ensure = "Present" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 index 77aebdb862..e255383bdd 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAcceptedDomain/3-Remove.ps1 @@ -16,7 +16,7 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'o365dsc.onmicrosoft.com' + Identity = $Domain DomainType = "Authoritative" Ensure = "Absent" Credential = $Credscredential From 31e14b2cdcf04017acf714a2eac93a406dc69ff0 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Mon, 22 Jan 2024 21:16:08 +0000 Subject: [PATCH 067/122] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/exchange/EXOAcceptedDomain.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/docs/resources/exchange/EXOAcceptedDomain.md b/docs/docs/resources/exchange/EXOAcceptedDomain.md index 47f107987e..c9a01aebbc 100644 --- a/docs/docs/resources/exchange/EXOAcceptedDomain.md +++ b/docs/docs/resources/exchange/EXOAcceptedDomain.md @@ -52,11 +52,12 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'o365dsc.onmicrosoft.com' + Identity = $Domain DomainType = "Authoritative" OutboundOnly = $false Ensure = "Present" @@ -85,7 +86,7 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'o365dsc.onmicrosoft.com' + Identity = $Domain DomainType = "Authoritative" OutboundOnly = $true # Updated Property Ensure = "Present" @@ -114,7 +115,7 @@ Configuration Example { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'o365dsc.onmicrosoft.com' + Identity = $Domain DomainType = "Authoritative" Ensure = "Absent" Credential = $Credscredential From 3bd1e10bdb562b31abe0f0269cda25f0db6c93e9 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Mon, 22 Jan 2024 21:19:35 +0000 Subject: [PATCH 068/122] 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 e2ce3aa0b9..7e18f63b4b 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -20,7 +20,7 @@ { EXOAcceptedDomain 'O365DSCDomain' { - Identity = 'o365dsc.onmicrosoft.com' + Identity = $Domain DomainType = "Authoritative" OutboundOnly = $false Ensure = "Present" From a231f4ca66e08aa5a693bba9438b117aac7ae637 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Mon, 22 Jan 2024 18:50:33 -0500 Subject: [PATCH 069/122] Fixes EXOActiveDeviceAccessRule Identity --- CHANGELOG.md | 3 +++ .../MSFT_EXOActiveSyncDeviceAccessRule.psm1 | 7 ++++--- .../EXOActiveSyncDeviceAccessRule/1-Create.ps1 | 2 +- ...DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 | 18 +++++++++--------- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 920fb6117b..b2044de5aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,9 @@ * AADGroup * Changed Set logic to restore groups from the deleted list if a match by DisplayName is found. +* EXOActiveSyncDeviceAccessRule + * Changed the way Identity is determined by using a combination of the + QueryString and Characteristic parameters. * 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_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 index 6c5bada108..57b2898d9b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOActiveSyncDeviceAccessRule/MSFT_EXOActiveSyncDeviceAccessRule.psm1 @@ -88,7 +88,7 @@ function Get-TargetResource { $AllActiveSyncDeviceAccessRules = Get-ActiveSyncDeviceAccessRule -ErrorAction Stop - $ActiveSyncDeviceAccessRule = $AllActiveSyncDeviceAccessRules | Where-Object -FilterScript { $_.Identity -eq $Identity } + $ActiveSyncDeviceAccessRule = $AllActiveSyncDeviceAccessRules | Where-Object -FilterScript { $_.Identity -eq "$QueryString ($Characteristic)" } if ($null -eq $ActiveSyncDeviceAccessRule) { @@ -212,7 +212,7 @@ function Set-TargetResource } $SetActiveSyncDeviceAccessRuleParams = @{ - Identity = $Identity + Identity = "$QueryString ($Characteristic)" AccessLevel = $AccessLevel Confirm = $false } @@ -229,7 +229,7 @@ function Set-TargetResource elseif ($Ensure -eq 'Absent' -and $currentActiveSyncDeviceAccessRuleConfig.Ensure -eq 'Present') { Write-Verbose -Message "Active Sync Device Access Rule '$($Identity)' exists but it shouldn't. Remove it." - Remove-ActiveSyncDeviceAccessRule -Identity $Identity -Confirm:$false + Remove-ActiveSyncDeviceAccessRule -Identity "$QueryString ($Characteristic)" -Confirm:$false } # CASE: Active Sync Device Access Rule exists and it should, but has different values than the desired ones elseif ($Ensure -eq 'Present' -and $currentActiveSyncDeviceAccessRuleConfig.Ensure -eq 'Present') @@ -324,6 +324,7 @@ function Test-TargetResource $ValuesToCheck.Remove('CertificatePath') | Out-Null $ValuesToCheck.Remove('CertificatePassword') | Out-Null $ValuesToCheck.Remove('ManagedIdentity') | Out-Null + $ValuesToCheck.Remove('Identity') | Out-Null $TestResult = Test-M365DSCParameterState -CurrentValues $CurrentValues ` -Source $($MyInvocation.MyCommand.Source) ` diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 index 6821be1b73..51c7077886 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOActiveSyncDeviceAccessRule/1-Create.ps1 @@ -19,7 +19,7 @@ Configuration Example { Identity = "ContosoPhone(DeviceOS)" Characteristic = "DeviceOS" - QueryString = "iOS 6.1 10B145" + QueryString = "iOS 6.1 10B146" AccessLevel = "Allow" Ensure = "Present" Credential = $Credscredential diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 index 96abf2b46a..0d41a9256a 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 @@ -45,7 +45,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Active Sync Device Access Rule should exist. Active Sync Device Access Rule is missing. Test should fail.' -Fixture { BeforeAll { $testParams = @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -55,7 +55,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-ActiveSyncDeviceAccessRule -MockWith { return @{ - Identity = 'ContosoDifferentPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -63,7 +63,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } Mock -CommandName Set-ActiveSyncDeviceAccessRule -MockWith { return @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -89,7 +89,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Active Sync Device Access Rule should exist. Active Sync Device Access Rule exists. Test should pass.' -Fixture { BeforeAll { $testParams = @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -99,7 +99,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-ActiveSyncDeviceAccessRule -MockWith { return @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -119,7 +119,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Active Sync Device Access Rule should exist. Active Sync Device Access Rule exists, AccessLevel mismatch. Test should fail.' -Fixture { BeforeAll { $testParams = @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -129,7 +129,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-ActiveSyncDeviceAccessRule -MockWith { return @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Block' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -137,7 +137,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } Mock -CommandName Set-ActiveSyncDeviceAccessRule -MockWith { return @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' @@ -165,7 +165,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } $ActiveSyncDeviceAccessRule = @{ - Identity = 'ContosoPhone' + Identity = 'iOS 6.1 10B145 (DeviceOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' From d593df93d6adb45eafb0ba506d0f5a6821400945 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 10:47:46 +0000 Subject: [PATCH 070/122] Fix deletion of resource --- CHANGELOG.md | 3 +++ .../MSFT_TeamsEmergencyCallingPolicy.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 920fb6117b..9160aa1ec2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,9 @@ * Fix CIM instances comparison in Test-TargetResource and export CompliantAppsList with the correct type FIXES [#4144](https://github.com/microsoft/Microsoft365DSC/issues/4144) +* TeamsEmergencyCallRoutingPolicy + * Fix deletion of resource + FIXES [#4219](https://github.com/microsoft/Microsoft365DSC/issues/4219) * DEPENDENCIES * Updated Microsoft.PowerApps.Administration.PowerShell to version 2.0.178. * Updated MSCloudLoginAssistant to version 1.1.7. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 index 8e9f4a2361..b047caaebe 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEmergencyCallingPolicy/MSFT_TeamsEmergencyCallingPolicy.psm1 @@ -237,7 +237,7 @@ function Set-TargetResource elseif ($Ensure -eq 'Absent' -and $CurrentValues.Ensure -eq 'Present') { Write-Verbose -Message "Removing existing Teams Emergency Calling Policy {$Identity}" - Remove-CsTeamsEmergencyCallingPolicy -Identity $Identity -Confirm:$false + Remove-CsTeamsEmergencyCallingPolicy -Identity $Identity } } From c73de83ff8adaa603b282ba8846b8e090f030278 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 11:04:40 +0000 Subject: [PATCH 071/122] Fix condition when resource is absent --- CHANGELOG.md | 3 +++ .../MSFT_TeamsEnhancedEncryptionPolicy.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 920fb6117b..af3a845868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. +* TeamsEnhancedEncryptionPolicy + * Fix condition when resource is absent + FIXES [#4221](https://github.com/microsoft/Microsoft365DSC/issues/4221) * DEPENDENCIES * Updated Microsoft.Graph dependencies to version 2.12.0. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 index 09e82d9114..599648d35f 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 @@ -269,7 +269,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false From 3ebe9a4197d247f1f10448d5dafe27fde63d137f Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 23 Jan 2024 07:05:38 -0500 Subject: [PATCH 072/122] Update Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 --- .../Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 index 0d41a9256a..999602c7c6 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOActiveSyncDeviceAccessRule.Tests.ps1 @@ -55,7 +55,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-ActiveSyncDeviceAccessRule -MockWith { return @{ - Identity = 'iOS 6.1 10B145 (DeviceOS)' + Identity = 'iOS 6.1 10B145 (WrongOS)' AccessLevel = 'Allow' Characteristic = 'DeviceOS' QueryString = 'iOS 6.1 10B145' From 4302c9868d5ab28dea2c799b3e12a54a37ea43af Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 12:06:43 +0000 Subject: [PATCH 073/122] Fix condition when resource is absent --- CHANGELOG.md | 3 +++ .../MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 920fb6117b..12b42df484 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. +* TeamsFeedbackPolicy + * Fix condition when resource is absent + FIXES [#4223](https://github.com/microsoft/Microsoft365DSC/issues/4223) * DEPENDENCIES * Updated Microsoft.Graph dependencies to version 2.12.0. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 index 9747cf0fba..b926a0dc45 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 @@ -311,7 +311,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false From 0ce71735b13ae20593b58d71c514f8c57ca514c9 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 12:14:54 +0000 Subject: [PATCH 074/122] Fix condition when resource is absent --- CHANGELOG.md | 3 +++ .../MSFT_TeamsFilesPolicy/MSFT_TeamsFilesPolicy.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 920fb6117b..0f2a2785a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. +* TeamsFilesPolicy + * Fix condition when resource is absent + FIXES [#4225](https://github.com/microsoft/Microsoft365DSC/issues/4225) * DEPENDENCIES * Updated Microsoft.Graph dependencies to version 2.12.0. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFilesPolicy/MSFT_TeamsFilesPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFilesPolicy/MSFT_TeamsFilesPolicy.psm1 index 9a5471c6f3..62af2c60f4 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFilesPolicy/MSFT_TeamsFilesPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFilesPolicy/MSFT_TeamsFilesPolicy.psm1 @@ -262,7 +262,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false From 5e3cd9938b879c3a5ed9ea5ea26bf021df688f82 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 12:22:04 +0000 Subject: [PATCH 075/122] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md b/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md index 2819cf2989..89fa8cecdf 100644 --- a/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md +++ b/docs/docs/resources/exchange/EXOActiveSyncDeviceAccessRule.md @@ -59,7 +59,7 @@ Configuration Example { Identity = "ContosoPhone(DeviceOS)" Characteristic = "DeviceOS" - QueryString = "iOS 6.1 10B145" + QueryString = "iOS 6.1 10B146" AccessLevel = "Allow" Ensure = "Present" Credential = $Credscredential From 3a5f71a38749834691045027cbbc6b51652b3aa2 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 12:24:37 +0000 Subject: [PATCH 076/122] 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 7e18f63b4b..6b8f07e640 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -30,7 +30,7 @@ { Identity = "ContosoPhone(DeviceOS)" Characteristic = "DeviceOS" - QueryString = "iOS 6.1 10B145" + QueryString = "iOS 6.1 10B146" AccessLevel = "Allow" Ensure = "Present" Credential = $Credscredential From 2c053e6a57360549018ba1ebd05c5579eb67be36 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 12:37:01 +0000 Subject: [PATCH 077/122] Fix condition when resource is absent --- CHANGELOG.md | 6 ++++++ .../MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 | 2 +- .../MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 | 2 +- .../MSFT_TeamsNetworkRoamingPolicy.psm1 | 2 +- .../MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 | 2 +- .../MSFT_TeamsTenantNetworkRegion.psm1 | 2 +- .../MSFT_TeamsTenantNetworkSite.psm1 | 2 +- .../MSFT_TeamsTenantNetworkSubnet.psm1 | 2 +- .../MSFT_TeamsTenantTrustedIPAddress.psm1 | 2 +- .../MSFT_TeamsTranslationRule.psm1 | 2 +- .../MSFT_TeamsUnassignedNumberTreatment.psm1 | 2 +- .../MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 | 2 +- .../MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 | 2 +- 13 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2044de5aa..c1a8c51ea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,12 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. +* TeamsIPPhonePolicy, TeamsMobilityPolicy, TeamsNetworkRoamingPolicy, + TeamsShiftsPolicy, TeamsTenantNetworkRegion, TeamsTenantNetworkSite, + TeamsTenantNetworkSubnet, TeamsTenantTrustedIPAddress, TeamsTranslationRule, + TeamsUnassignedNumberTreatment, TeamsVdiPolicy, TeamsWorkloadPolicy + * Fix condition when resource is absent + FIXES [#4227](https://github.com/microsoft/Microsoft365DSC/issues/4227) * DEPENDENCIES * Updated Microsoft.Graph dependencies to version 2.12.0. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 index 72d842411e..54f53af72b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 @@ -333,7 +333,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 index 343e946dda..374c6590b4 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 @@ -288,7 +288,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 index 429d385483..330f531a6e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 @@ -269,7 +269,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 index 4f05559964..bd40f4bb13 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 @@ -338,7 +338,7 @@ function Test-TargetResource $ValuesToCheck.Remove('Identity') | Out-Null $ValuesToCheck.Remove('EnableShiftPresence') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 index bf582ea221..56990d3f89 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 @@ -256,7 +256,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 index 9452d501e5..2f309d1086 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 @@ -334,7 +334,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 index 15b7746e24..7905b07005 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 @@ -269,7 +269,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 index 047bfbad73..d7e904d2fa 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 @@ -258,7 +258,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 index f6757f346a..dbd8ccaf9a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 @@ -269,7 +269,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 index 2fe128ea70..af974b2826 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 @@ -298,7 +298,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 index 79535d140b..5d925da1c2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 @@ -256,7 +256,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 index f43356e5b7..dfeb7e8075 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 @@ -321,7 +321,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false From 532cb2ee820bcb2d7677f84fa56bc9547084a1d7 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 23 Jan 2024 08:09:35 -0500 Subject: [PATCH 078/122] Fixes Integration --- .../Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 | 8 ++++---- .../Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 index 909eabd2df..0bc19986dc 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 @@ -18,10 +18,10 @@ Configuration Example EXOAddressBookPolicy 'ConfigureAddressBookPolicy' { Name = "All Fabrikam ABP" - AddressLists = "\All Fabrikam","\All Fabrikam Mailboxes","\All Fabrikam DLs","\All Fabrikam Contacts" - RoomList = "\All Fabrikam-Rooms" - OfflineAddressBook = "\Fabrikam-All-OAB" - GlobalAddressList = "\All Fabrikam" + AddressLists = "\All Distribution Lists" + RoomList = "\All Rooms" + OfflineAddressBook = "\Offline Global Address List" + GlobalAddressList = "\All Groups" Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 index f32e04fcbe..46c57d590d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 @@ -18,10 +18,10 @@ Configuration Example EXOAddressBookPolicy 'ConfigureAddressBookPolicy' { Name = "All Fabrikam ABP" - AddressLists = "\All Fabrikam","\All Fabrikam Mailboxes","\All Fabrikam Contacts" # Updated Property - RoomList = "\All Fabrikam-Rooms" - OfflineAddressBook = "\Fabrikam-All-OAB" - GlobalAddressList = "\All Fabrikam" + AddressLists = "\All Users" # Updated Property + RoomList = "\All Rooms" + OfflineAddressBook = "\Offline Global Address List" + GlobalAddressList = "\All Groups" Ensure = "Present" Credential = $Credscredential } From fd87ff7d542c3df429c3571ee306e05e5c222137 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 13:10:45 +0000 Subject: [PATCH 079/122] Updated Resources and Cmdlet documentation pages --- .../resources/exchange/EXOAddressBookPolicy.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/docs/resources/exchange/EXOAddressBookPolicy.md b/docs/docs/resources/exchange/EXOAddressBookPolicy.md index ae74810210..74f2b44537 100644 --- a/docs/docs/resources/exchange/EXOAddressBookPolicy.md +++ b/docs/docs/resources/exchange/EXOAddressBookPolicy.md @@ -59,10 +59,10 @@ Configuration Example EXOAddressBookPolicy 'ConfigureAddressBookPolicy' { Name = "All Fabrikam ABP" - AddressLists = "\All Fabrikam","\All Fabrikam Mailboxes","\All Fabrikam DLs","\All Fabrikam Contacts" - RoomList = "\All Fabrikam-Rooms" - OfflineAddressBook = "\Fabrikam-All-OAB" - GlobalAddressList = "\All Fabrikam" + AddressLists = "\All Distribution Lists" + RoomList = "\All Rooms" + OfflineAddressBook = "\Offline Global Address List" + GlobalAddressList = "\All Groups" Ensure = "Present" Credential = $Credscredential } @@ -91,10 +91,10 @@ Configuration Example EXOAddressBookPolicy 'ConfigureAddressBookPolicy' { Name = "All Fabrikam ABP" - AddressLists = "\All Fabrikam","\All Fabrikam Mailboxes","\All Fabrikam Contacts" # Updated Property - RoomList = "\All Fabrikam-Rooms" - OfflineAddressBook = "\Fabrikam-All-OAB" - GlobalAddressList = "\All Fabrikam" + AddressLists = "\All Users" # Updated Property + RoomList = "\All Rooms" + OfflineAddressBook = "\Offline Global Address List" + GlobalAddressList = "\All Groups" Ensure = "Present" Credential = $Credscredential } From ac3a165b1115cf41dd8097c145483b0b078fc000 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 13:13:38 +0000 Subject: [PATCH 080/122] Updated {Create} EXO Integration Tests --- .../M365DSCIntegration.EXO.Create.Tests.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 index 6b8f07e640..52c83a7146 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -38,10 +38,10 @@ EXOAddressBookPolicy 'ConfigureAddressBookPolicy' { Name = "All Fabrikam ABP" - AddressLists = "\All Fabrikam","\All Fabrikam Mailboxes","\All Fabrikam DLs","\All Fabrikam Contacts" - RoomList = "\All Fabrikam-Rooms" - OfflineAddressBook = "\Fabrikam-All-OAB" - GlobalAddressList = "\All Fabrikam" + AddressLists = "\All Distribution Lists" + RoomList = "\All Rooms" + OfflineAddressBook = "\Offline Global Address List" + GlobalAddressList = "\All Groups" Ensure = "Present" Credential = $Credscredential } From 3f56911f17fac9a2bf88c445c1c812aca749e9b4 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 13:24:36 +0000 Subject: [PATCH 081/122] Fix deletion of resource --- CHANGELOG.md | 3 +++ .../MSFT_TeamsMeetingBroadcastPolicy.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2044de5aa..75e2faf7b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,9 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. +* TeamsMeetingBroadcastPolicy + * Fix deletion of resource + FIXES [#4231](https://github.com/microsoft/Microsoft365DSC/issues/4231) * DEPENDENCIES * Updated Microsoft.Graph dependencies to version 2.12.0. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 index bc67268439..8210eeb73e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMeetingBroadcastPolicy/MSFT_TeamsMeetingBroadcastPolicy.psm1 @@ -200,7 +200,7 @@ function Set-TargetResource } elseif ($Ensure -eq 'Absent' -and $currentValues.Ensure -eq 'Present') { - Remove-CsTeamsMeetingBroadcastPolicy -Identity $Identity -Confirm:$false + Remove-CsTeamsMeetingBroadcastPolicy -Identity $Identity } } From 97d582617ec0e4874d3a5658a243af10d20cc54f Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 23 Jan 2024 08:26:47 -0500 Subject: [PATCH 082/122] Fixes Integration --- .../Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 | 4 ++-- .../Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 index 0bc19986dc..976c4867af 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/1-Create.ps1 @@ -20,8 +20,8 @@ Configuration Example Name = "All Fabrikam ABP" AddressLists = "\All Distribution Lists" RoomList = "\All Rooms" - OfflineAddressBook = "\Offline Global Address List" - GlobalAddressList = "\All Groups" + OfflineAddressBook = "\Default Offline Address Book" + GlobalAddressList = "\Default Global Address List" Ensure = "Present" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 index 46c57d590d..894b0a6913 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAddressBookPolicy/2-Update.ps1 @@ -18,10 +18,10 @@ Configuration Example EXOAddressBookPolicy 'ConfigureAddressBookPolicy' { Name = "All Fabrikam ABP" - AddressLists = "\All Users" # Updated Property + AddressLists = "\All Users" RoomList = "\All Rooms" - OfflineAddressBook = "\Offline Global Address List" - GlobalAddressList = "\All Groups" + OfflineAddressBook = "\Default Offline Address Book" + GlobalAddressList = "\Default Global Address List" Ensure = "Present" Credential = $Credscredential } From c333fb0e3cb0f5b1e2fde1ade167b580fd93a78e Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 13:28:02 +0000 Subject: [PATCH 083/122] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/exchange/EXOAddressBookPolicy.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/docs/resources/exchange/EXOAddressBookPolicy.md b/docs/docs/resources/exchange/EXOAddressBookPolicy.md index 74f2b44537..8c9fbd7320 100644 --- a/docs/docs/resources/exchange/EXOAddressBookPolicy.md +++ b/docs/docs/resources/exchange/EXOAddressBookPolicy.md @@ -61,8 +61,8 @@ Configuration Example Name = "All Fabrikam ABP" AddressLists = "\All Distribution Lists" RoomList = "\All Rooms" - OfflineAddressBook = "\Offline Global Address List" - GlobalAddressList = "\All Groups" + OfflineAddressBook = "\Default Offline Address Book" + GlobalAddressList = "\Default Global Address List" Ensure = "Present" Credential = $Credscredential } @@ -91,10 +91,10 @@ Configuration Example EXOAddressBookPolicy 'ConfigureAddressBookPolicy' { Name = "All Fabrikam ABP" - AddressLists = "\All Users" # Updated Property + AddressLists = "\All Users" RoomList = "\All Rooms" - OfflineAddressBook = "\Offline Global Address List" - GlobalAddressList = "\All Groups" + OfflineAddressBook = "\Default Offline Address Book" + GlobalAddressList = "\Default Global Address List" Ensure = "Present" Credential = $Credscredential } From a4248667304c8dbde3e7f0daa8363f4d6eba5d26 Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Tue, 23 Jan 2024 13:32:35 +0000 Subject: [PATCH 084/122] Updated {Create} EXO Integration Tests --- .../Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 index 52c83a7146..80b7a3be80 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -40,8 +40,8 @@ Name = "All Fabrikam ABP" AddressLists = "\All Distribution Lists" RoomList = "\All Rooms" - OfflineAddressBook = "\Offline Global Address List" - GlobalAddressList = "\All Groups" + OfflineAddressBook = "\Default Offline Address Book" + GlobalAddressList = "\Default Global Address List" Ensure = "Present" Credential = $Credscredential } From 0725914a15cedec67578afa3d9decf3709205967 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Tue, 23 Jan 2024 09:01:47 -0500 Subject: [PATCH 085/122] 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 086/122] 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 087/122] 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 088/122] 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 089/122] 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 090/122] 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 091/122] 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 092/122] 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 093/122] 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 094/122] 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 095/122] 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 } From 0d4f35b415c60d2a37e39185fe08273b98180d9d Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Tue, 23 Jan 2024 22:43:35 +0100 Subject: [PATCH 096/122] Fixed #4240 --- CHANGELOG.md | 3 + .../MSFT_SCAutoSensitivityLabelRule.psm1 | 75 ++++++++++--------- 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2044de5aa..347db9226f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,9 @@ * EXOActiveSyncDeviceAccessRule * Changed the way Identity is determined by using a combination of the QueryString and Characteristic parameters. +* SCAutoSensitivityLabelRule + * Correct export indentation, which caused an issue with report conversion to JSON. + FIXES [[#4240](https://github.com/microsoft/Microsoft365DSC/issues/4240)] * 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_SCAutoSensitivityLabelRule/MSFT_SCAutoSensitivityLabelRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SCAutoSensitivityLabelRule/MSFT_SCAutoSensitivityLabelRule.psm1 index 1f22ae0608..ab4ff4e9be 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SCAutoSensitivityLabelRule/MSFT_SCAutoSensitivityLabelRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SCAutoSensitivityLabelRule/MSFT_SCAutoSensitivityLabelRule.psm1 @@ -1275,81 +1275,84 @@ function ConvertTo-SCDLPSensitiveInformationStringGroup foreach ($SensitiveInformationHash in $InformationArray) { - $StringContent = "MSFT_SCDLPContainsSensitiveInformation`r`n {`r`n" + $StringContent = "MSFT_SCDLPContainsSensitiveInformation {`r`n" if ($null -ne $InformationArray.Groups) { - $StringContent += " operator = '$($SensitiveInformationHash.operator.Replace("'", "''"))'`r`n" - $StringContent += " Groups = `r`n@(" + $StringContent += " operator = '$($SensitiveInformationHash.operator.Replace("'", "''"))'`r`n" + $StringContent += " Groups = @(`r`n" } foreach ($group in $SensitiveInformationHash.Groups) { - $StringContent += "MSFT_SCDLPContainsSensitiveInformationGroup`r`n {`r`n" - $StringContent += " operator = '$($group.operator.Replace("'", "''"))'`r`n" - $StringContent += " name = '$($group.name.Replace("'", "''"))'`r`n" + $StringContent += " MSFT_SCDLPContainsSensitiveInformationGroup {`r`n" + $StringContent += " operator = '$($group.operator.Replace("'", "''"))'`r`n" + $StringContent += " name = '$($group.name.Replace("'", "''"))'`r`n" if ($null -ne $group.sensitivetypes) { - $StringContent += ' SensitiveInformation = @(' + $StringContent += " SensitiveInformation = @(`r`n" foreach ($sit in $group.sensitivetypes) { - $StringContent += " MSFT_SCDLPSensitiveInformation`r`n {`r`n" - $StringContent += " name = '$($sit.name.Replace("'", "''"))'`r`n" + $StringContent += " MSFT_SCDLPSensitiveInformation {`r`n" + $StringContent += " name = '$($sit.name.Replace("'", "''"))'`r`n" if ($null -ne $sit.id) { - $StringContent += " id = '$($sit.id)'`r`n" + $StringContent += " id = '$($sit.id)'`r`n" } if ($null -ne $sit.maxconfidence) { - $StringContent += " maxconfidence = '$($sit.maxconfidence)'`r`n" + $StringContent += " maxconfidence = '$($sit.maxconfidence)'`r`n" } if ($null -ne $sit.minconfidence) { - $StringContent += " minconfidence = '$($sit.minconfidence)'`r`n" + $StringContent += " minconfidence = '$($sit.minconfidence)'`r`n" } if ($null -ne $sit.classifiertype) { - $StringContent += " classifiertype = '$($sit.classifiertype)'`r`n" + $StringContent += " classifiertype = '$($sit.classifiertype)'`r`n" } if ($null -ne $sit.mincount) { - $StringContent += " mincount = '$($sit.mincount)'`r`n" + $StringContent += " mincount = '$($sit.mincount)'`r`n" } if ($null -ne $sit.maxcount) { - $StringContent += " maxcount = '$($sit.maxcount)'`r`n" + $StringContent += " maxcount = '$($sit.maxcount)'`r`n" } - $StringContent += " }`r`n" + $StringContent += " }`r`n" } - $StringContent += " )}`r`n" + $StringContent += " )`r`n" + $StringContent += " }`r`n" } if ($null -ne $group.labels) { - $StringContent += ' labels = @(' + $StringContent += " labels = @(`r`n" foreach ($label in $group.labels) { - $StringContent += " MSFT_SCDLPLabel`r`n {`r`n" - $StringContent += " name = '$($label.name.Replace("'", "''"))'`r`n" + $StringContent += " MSFT_SCDLPLabel {`r`n" + $StringContent += " name = '$($label.name.Replace("'", "''"))'`r`n" if ($null -ne $label.id) { - $StringContent += " id = '$($label.id)'`r`n" + $StringContent += " id = '$($label.id)'`r`n" } if ($null -ne $label.type) { - $StringContent += " type = '$($label.type)'`r`n" + $StringContent += " type = '$($label.type)'`r`n" } - $StringContent += " }`r`n" + $StringContent += " }`r`n" } - $StringContent += " )}`r`n" + $StringContent += " )`r`n" + $StringContent += " }`r`n" } } - $StringContent += " )}`r`n" + $StringContent += " )`r`n" + $StringContent += " }`r`n" $result += $StringContent } return $result @@ -1365,50 +1368,50 @@ function ConvertTo-SCDLPSensitiveInformationString $InformationArray ) $result = '' - $StringContent = "MSFT_SCDLPContainsSensitiveInformation`r`n {`r`n" + $StringContent = "MSFT_SCDLPContainsSensitiveInformation {`r`n" $StringContent += ' SensitiveInformation = ' $StringContent += "@(`r`n" $result += $StringContent foreach ($SensitiveInformationHash in $InformationArray) { - $StringContent = "MSFT_SCDLPSensitiveInformation`r`n {`r`n" - $StringContent += " name = '$($SensitiveInformationHash.name.Replace("'", "''"))'`r`n" + $StringContent = " MSFT_SCDLPSensitiveInformation`r`n {`r`n" + $StringContent += " name = '$($SensitiveInformationHash.name.Replace("'", "''"))'`r`n" if ($null -ne $SensitiveInformationHash.id) { - $StringContent += " id = '$($SensitiveInformationHash.id)'`r`n" + $StringContent += " id = '$($SensitiveInformationHash.id)'`r`n" } if ($null -ne $SensitiveInformationHash.maxconfidence) { - $StringContent += " maxconfidence = '$($SensitiveInformationHash.maxconfidence)'`r`n" + $StringContent += " maxconfidence = '$($SensitiveInformationHash.maxconfidence)'`r`n" } if ($null -ne $SensitiveInformationHash.minconfidence) { - $StringContent += " minconfidence = '$($SensitiveInformationHash.minconfidence)'`r`n" + $StringContent += " minconfidence = '$($SensitiveInformationHash.minconfidence)'`r`n" } if ($null -ne $SensitiveInformationHash.classifiertype) { - $StringContent += " classifiertype = '$($SensitiveInformationHash.classifiertype)'`r`n" + $StringContent += " classifiertype = '$($SensitiveInformationHash.classifiertype)'`r`n" } if ($null -ne $SensitiveInformationHash.mincount) { - $StringContent += " mincount = '$($SensitiveInformationHash.mincount)'`r`n" + $StringContent += " mincount = '$($SensitiveInformationHash.mincount)'`r`n" } if ($null -ne $SensitiveInformationHash.maxcount) { - $StringContent += " maxcount = '$($SensitiveInformationHash.maxcount)'`r`n" + $StringContent += " maxcount = '$($SensitiveInformationHash.maxcount)'`r`n" } - $StringContent += " }`r`n" + $StringContent += " }`r`n" $result += $StringContent } - $result += ' )' + $result += " )`r`n" $result += " }`r`n" return $result } From 3f221e894ac8a20784498c12fe0b191d89d14213 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 22:54:40 +0000 Subject: [PATCH 097/122] Add default value to Ensure --- .../MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 index b14fb3e016..6e61b8db5e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCortanaPolicy/MSFT_TeamsCortanaPolicy.psm1 @@ -20,7 +20,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -110,7 +110,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -222,7 +222,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] From c75146813af4ed8bb35adb2978f2c1f79e4d7153 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 22:55:34 +0000 Subject: [PATCH 098/122] Add default value to Ensure --- .../MSFT_TeamsCallParkPolicy/MSFT_TeamsCallParkPolicy.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallParkPolicy/MSFT_TeamsCallParkPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallParkPolicy/MSFT_TeamsCallParkPolicy.psm1 index cb03861727..aaba733498 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallParkPolicy/MSFT_TeamsCallParkPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallParkPolicy/MSFT_TeamsCallParkPolicy.psm1 @@ -31,7 +31,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -135,7 +135,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -258,7 +258,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] From 5fdc362fddf48ca9e7c43f5cea32df38a48bd5b5 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 22:56:43 +0000 Subject: [PATCH 099/122] Add default value to Ensure --- .../MSFT_TeamsComplianceRecordingPolicy.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 index abe0d6a964..4a37550baa 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsComplianceRecordingPolicy/MSFT_TeamsComplianceRecordingPolicy.psm1 @@ -31,7 +31,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -144,7 +144,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -267,7 +267,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] From 0ea29251a3b077680d6506fad5e6ef48cccac366 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 22:57:25 +0000 Subject: [PATCH 100/122] Add default value to Ensure --- .../MSFT_TeamsAudioConferencingPolicy.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 index 3d3ef592a3..28dd0906ff 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAudioConferencingPolicy/MSFT_TeamsAudioConferencingPolicy.psm1 @@ -19,7 +19,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -108,7 +108,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -219,7 +219,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] From 6f863a561011eb20d038304183fc5d3051275a99 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 22:58:47 +0000 Subject: [PATCH 101/122] Add default value to Ensure --- .../MSFT_TeamsEnhancedEncryptionPolicy.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 index 599648d35f..48da559d9d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEnhancedEncryptionPolicy/MSFT_TeamsEnhancedEncryptionPolicy.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -117,7 +117,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -232,7 +232,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] From 0e997cae882e3d3e8635a5000d63c7e7d22b1858 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 22:59:18 +0000 Subject: [PATCH 102/122] Add default value to Ensure --- .../MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 index b926a0dc45..e902ca70c9 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 @@ -36,7 +36,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -146,7 +146,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -274,7 +274,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] From 44330cd12edc2c8077b318333bf30e854e61faea Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 22:59:40 +0000 Subject: [PATCH 103/122] Add default value to Ensure --- .../MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 index 9747cf0fba..cf82328242 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsFeedbackPolicy/MSFT_TeamsFeedbackPolicy.psm1 @@ -36,7 +36,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -146,7 +146,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -274,7 +274,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] From 75b110feeb9ab3be8672529f9eb4d2d34a4cca3c Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Tue, 23 Jan 2024 23:02:30 +0000 Subject: [PATCH 104/122] Add default value to Ensure --- .../MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 | 6 +++--- .../MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 | 6 +++--- .../MSFT_TeamsNetworkRoamingPolicy.psm1 | 6 +++--- .../MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 | 6 +++--- .../MSFT_TeamsTenantNetworkRegion.psm1 | 6 +++--- .../MSFT_TeamsTenantNetworkSite.psm1 | 6 +++--- .../MSFT_TeamsTenantNetworkSubnet.psm1 | 6 +++--- .../MSFT_TeamsTenantTrustedIPAddress.psm1 | 6 +++--- .../MSFT_TeamsTranslationRule.psm1 | 6 +++--- .../MSFT_TeamsUnassignedNumberTreatment.psm1 | 6 +++--- .../MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 | 6 +++--- .../MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 | 6 +++--- 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 index 54f53af72b..c2061ace70 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsIPPhonePolicy/MSFT_TeamsIPPhonePolicy.psm1 @@ -43,7 +43,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -161,7 +161,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -296,7 +296,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 index 374c6590b4..0a9f8ed210 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 @@ -29,7 +29,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -130,7 +130,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -251,7 +251,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 index 330f531a6e..abe450cad1 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsNetworkRoamingPolicy/MSFT_TeamsNetworkRoamingPolicy.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -117,7 +117,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -232,7 +232,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 index bd40f4bb13..bdab72fdf6 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsShiftsPolicy/MSFT_TeamsShiftsPolicy.psm1 @@ -42,7 +42,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -160,7 +160,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -300,7 +300,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 index 56990d3f89..582fa43630 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkRegion/MSFT_TeamsTenantNetworkRegion.psm1 @@ -19,7 +19,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -108,7 +108,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -219,7 +219,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 index 2f309d1086..68c4d63b7b 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSite/MSFT_TeamsTenantNetworkSite.psm1 @@ -43,7 +43,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -162,7 +162,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -297,7 +297,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 index 7905b07005..e662126d4d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantNetworkSubnet/MSFT_TeamsTenantNetworkSubnet.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -117,7 +117,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -232,7 +232,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 index d7e904d2fa..a2782d3c9e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTenantTrustedIPAddress/MSFT_TeamsTenantTrustedIPAddress.psm1 @@ -19,7 +19,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -110,7 +110,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -221,7 +221,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 index dbd8ccaf9a..68ddebee03 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsTranslationRule/MSFT_TeamsTranslationRule.psm1 @@ -23,7 +23,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -117,7 +117,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -232,7 +232,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 index af974b2826..2f1287e0b7 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsUnassignedNumberTreatment/MSFT_TeamsUnassignedNumberTreatment.psm1 @@ -32,7 +32,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -137,7 +137,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -261,7 +261,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 index 5d925da1c2..41e02cfed0 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsVdiPolicy/MSFT_TeamsVdiPolicy.psm1 @@ -19,7 +19,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -108,7 +108,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -219,7 +219,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 index dfeb7e8075..d205cf93fd 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsWorkloadPolicy/MSFT_TeamsWorkloadPolicy.psm1 @@ -39,7 +39,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -153,7 +153,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -284,7 +284,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] From d26c168c15cca50247e386ab48838be13a459389 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Wed, 24 Jan 2024 00:41:39 +0000 Subject: [PATCH 105/122] Add missing attributes --- CHANGELOG.md | 3 + .../MSFT_TeamsEventsPolicy.psm1 | 140 ++++++++++++++++-- .../MSFT_TeamsEventsPolicy.schema.mof | 8 + 3 files changed, 142 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb00d07578..de113cbce3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,9 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. +* TeamsEventsPolicy + * Add missing attributes + FIXES [#4242](https://github.com/microsoft/Microsoft365DSC/issues/4242) * DEPENDENCIES * Updated Microsoft.Graph dependencies to version 2.12.0. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.psm1 index 3aecdaae93..8ccbb925c6 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.psm1 @@ -22,6 +22,44 @@ function Get-TargetResource [ValidateSet('Everyone', 'EveryoneInCompanyExcludingGuests')] $EventAccessType, + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowEmailEditing, + + [Parameter()] + [System.Boolean] + $AllowEventIntegrations, + + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowTownhalls, + + [Parameter()] + [ValidateSet('DefaultOnly', 'DefaultAndPredefinedOnly', 'AllQuestions')] + [System.String] + $AllowedQuestionTypesInRegistrationForm, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedWebinarTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedTownhallTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('Optimized', 'None')] + [System.String] + $TownhallChatExperience, + + [Parameter()] + [System.Boolean] + $UseMicrosoftECDN, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] @@ -75,15 +113,23 @@ function Get-TargetResource } Write-Verbose -Message "Found Teams Events Policy {$Identity}" $result = @{ - Identity = $Identity - Description = $policy.Description - AllowWebinars = $policy.AllowWebinars - EventAccessType = $policy.EventAccessType - Ensure = 'Present' - Credential = $Credential - ApplicationId = $ApplicationId - TenantId = $TenantId - CertificateThumbprint = $CertificateThumbprint + Identity = $Identity + Description = $policy.Description + AllowWebinars = $policy.AllowWebinars + EventAccessType = $policy.EventAccessType + AllowEmailEditing = $policy.AllowEmailEditing + AllowEventIntegrations = $policy.AllowEventIntegrations + AllowTownhalls = $policy.AllowTownhalls + AllowedQuestionTypesInRegistrationForm = $policy.AllowedQuestionTypesInRegistrationForm + AllowedWebinarTypesForRecordingPublish = $policy.AllowedWebinarTypesForRecordingPublish + AllowedTownhallTypesForRecordingPublish = $policy.AllowedTownhallTypesForRecordingPublish + TownhallChatExperience = $policy.TownhallChatExperience + UseMicrosoftECDN = $policy.UseMicrosoftECDN + Ensure = 'Present' + Credential = $Credential + ApplicationId = $ApplicationId + TenantId = $TenantId + CertificateThumbprint = $CertificateThumbprint } return $result @@ -123,6 +169,44 @@ function Set-TargetResource [ValidateSet('Everyone', 'EveryoneInCompanyExcludingGuests')] $EventAccessType, + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowEmailEditing, + + [Parameter()] + [System.Boolean] + $AllowEventIntegrations, + + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowTownhalls, + + [Parameter()] + [ValidateSet('DefaultOnly', 'DefaultAndPredefinedOnly', 'AllQuestions')] + [System.String] + $AllowedQuestionTypesInRegistrationForm, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedWebinarTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedTownhallTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('Optimized', 'None')] + [System.String] + $TownhallChatExperience, + + [Parameter()] + [System.Boolean] + $UseMicrosoftECDN, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] @@ -212,6 +296,44 @@ function Test-TargetResource [ValidateSet('Everyone', 'EveryoneInCompanyExcludingGuests')] $EventAccessType, + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowEmailEditing, + + [Parameter()] + [System.Boolean] + $AllowEventIntegrations, + + [Parameter()] + [ValidateSet('Enabled', 'Disabled')] + [System.String] + $AllowTownhalls, + + [Parameter()] + [ValidateSet('DefaultOnly', 'DefaultAndPredefinedOnly', 'AllQuestions')] + [System.String] + $AllowedQuestionTypesInRegistrationForm, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedWebinarTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('None', 'InviteOnly', 'EveryoneInCompanyIncludingGuests', 'Everyone')] + [System.String] + $AllowedTownhallTypesForRecordingPublish, + + [Parameter()] + [ValidateSet('Optimized', 'None')] + [System.String] + $TownhallChatExperience, + + [Parameter()] + [System.Boolean] + $UseMicrosoftECDN, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.schema.mof index 68831ce62f..f8d8aea02d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsEventsPolicy/MSFT_TeamsEventsPolicy.schema.mof @@ -3,9 +3,17 @@ class MSFT_TeamsEventsPolicy : OMI_BaseResource { [Key, Description("Identity of the Teams Events Policy.")] String Identity; [Write, Description("Description of the Teams Events Policy.")] String Description; + [Write, Description("This setting governs if a user is allowed to edit the communication emails in Teams Town Hall or Teams Webinar events."), ValueMap{"Disabled","Enabled"}, Values{"Disabled","Enabled"}] String AllowEmailEditing; + [Write, Description("This setting governs access to the integrations tab in the event creation workflow.")] Boolean AllowEventIntegrations; [Write, Description("Determines if webinars are allowed by the policy or not."), ValueMap{"Disabled","Enabled"}, Values{"Disabled","Enabled"}] String AllowWebinars; + [Write, Description("This setting governs if a user can create town halls using Teams Events."), ValueMap{"Disabled","Enabled"}, Values{"Disabled","Enabled"}] String AllowTownhalls; + [Write, Description("This setting governs which users in a tenant can add which registration form questions to an event registration page for attendees to answer when registering for the event."), ValueMap{"DefaultOnly","DefaultAndPredefinedOnly","AllQuestions"}, Values{"DefaultOnly","DefaultAndPredefinedOnly","AllQuestions"}] String AllowedQuestionTypesInRegistrationForm; + [Write, Description("This setting describes how IT admins can control which types of Town Hall attendees can have their recordings published."), ValueMap{"None","InviteOnly","EveryoneInCompanyIncludingGuests","Everyone"}, Values{"None","InviteOnly","EveryoneInCompanyIncludingGuests","Everyone"}] String AllowedTownhallTypesForRecordingPublish; + [Write, Description("This setting describes how IT admins can control which types of webinar attendees can have their recordings published."), ValueMap{"None","InviteOnly","EveryoneInCompanyIncludingGuests","Everyone"}, Values{"None","InviteOnly","EveryoneInCompanyIncludingGuests","Everyone"}] String AllowedWebinarTypesForRecordingPublish; [Write, Description("Defines who is allowed to join the event."), ValueMap{"Everyone", "EveryoneInCompanyExcludingGuests"}, Values{"Everyone", "EveryoneInCompanyExcludingGuests"}] String EventAccessType; [Write, Description("Present ensures the policy exists, absent ensures it is removed."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; + [Write, Description("This setting governs whether the user can enable the Comment Stream chat experience for Town Halls."), ValueMap{"Optimized","None"}, Values{"Optimized","None"}] String TownhallChatExperience; + [Write, Description("This setting governs whether the global admin disables this property and prevents the organizers from creating town halls that use Microsoft eCDN even though they have been assigned a Teams Premium license.")] Boolean UseMicrosoftECDN; [Write, Description("Credentials of the Teams Global Admin."), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; [Write, Description("Name of the Azure Active Directory tenant used for authentication. Format contoso.onmicrosoft.com")] String TenantId; From 0c3281258da6186b1d563b7ae43ebd140561168d Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Wed, 24 Jan 2024 01:02:48 +0000 Subject: [PATCH 106/122] Update tests --- ...icrosoft365DSC.TeamsEventsPolicy.Tests.ps1 | 144 +++++++++++++----- 1 file changed, 104 insertions(+), 40 deletions(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 index 1be3297a5b..15478c031c 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 @@ -53,12 +53,20 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name "When Policy doesn't exist but should" -Fixture { BeforeAll { $testParams = @{ - Description = 'Desc' - Ensure = 'Present' - Credential = $Credential - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Ensure = 'Present' + Credential = $Credential + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled' + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; + UseMicrosoftECDN = $True; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { @@ -83,20 +91,36 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Policy exists but is not in the Desired State' -Fixture { BeforeAll { $testParams = @{ - Description = 'Desc' - Ensure = 'Present' - Credential = $Credential - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Ensure = 'Present' + Credential = $Credential + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled' + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; + UseMicrosoftECDN = $True; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { return @{ - Description = 'Desc' - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Disabled'; #Drift + Description = 'Desc' + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Disabled'; # Drift + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; + UseMicrosoftECDN = $True; } } } @@ -119,20 +143,36 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Policy exists and is already in the Desired State' -Fixture { BeforeAll { $testParams = @{ - Description = 'Desc' - Ensure = 'Present' - Credential = $Credential - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Ensure = 'Present' + Credential = $Credential + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled'; + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; + UseMicrosoftECDN = $True; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { return @{ - Description = 'Desc' - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled'; + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; + UseMicrosoftECDN = $True; } } } @@ -149,20 +189,36 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'Policy exists but it should not' -Fixture { BeforeAll { $testParams = @{ - Description = 'Desc' - Ensure = 'Absent' - Credential = $Credential - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Ensure = 'Absent' + Credential = $Credential + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled'; + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; + UseMicrosoftECDN = $True; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { return @{ - Description = 'Desc' - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled'; + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; + UseMicrosoftECDN = $True; } } } @@ -191,10 +247,18 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { return @{ - Description = 'Desc' - Identity = 'TestPolicy' - EventAccessType = 'EveryoneInCompanyExcludingGuests' - AllowWebinars = 'Enabled' + Description = 'Desc' + Identity = 'TestPolicy' + EventAccessType = 'EveryoneInCompanyExcludingGuests' + AllowWebinars = 'Enabled'; + AllowedQuestionTypesInRegistrationForm = "AllQuestions"; + AllowedTownhallTypesForRecordingPublish = "Everyone"; + AllowedWebinarTypesForRecordingPublish = "Everyone"; + AllowEmailEditing = "Enabled"; + AllowEventIntegrations = $False; + AllowTownhalls = "Enabled"; + TownhallChatExperience = "Optimized"; + UseMicrosoftECDN = $True; } } } From 9b881a5a7cae190c2694da883a34f2b47a1f41dc Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Wed, 24 Jan 2024 01:15:03 +0000 Subject: [PATCH 107/122] Remove param causing trouble in tests --- .../Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 index 15478c031c..46df144cb8 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsEventsPolicy.Tests.ps1 @@ -66,7 +66,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { AllowEventIntegrations = $False; AllowTownhalls = "Enabled"; TownhallChatExperience = "Optimized"; - UseMicrosoftECDN = $True; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { @@ -104,7 +103,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { AllowEventIntegrations = $False; AllowTownhalls = "Enabled"; TownhallChatExperience = "Optimized"; - UseMicrosoftECDN = $True; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { @@ -120,7 +118,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { AllowEventIntegrations = $False; AllowTownhalls = "Enabled"; TownhallChatExperience = "Optimized"; - UseMicrosoftECDN = $True; } } } @@ -156,7 +153,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { AllowEventIntegrations = $False; AllowTownhalls = "Enabled"; TownhallChatExperience = "Optimized"; - UseMicrosoftECDN = $True; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { @@ -172,7 +168,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { AllowEventIntegrations = $False; AllowTownhalls = "Enabled"; TownhallChatExperience = "Optimized"; - UseMicrosoftECDN = $True; } } } @@ -202,7 +197,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { AllowEventIntegrations = $False; AllowTownhalls = "Enabled"; TownhallChatExperience = "Optimized"; - UseMicrosoftECDN = $True; } Mock -CommandName Get-CsTeamsEventsPolicy -MockWith { @@ -218,7 +212,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { AllowEventIntegrations = $False; AllowTownhalls = "Enabled"; TownhallChatExperience = "Optimized"; - UseMicrosoftECDN = $True; } } } @@ -258,7 +251,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { AllowEventIntegrations = $False; AllowTownhalls = "Enabled"; TownhallChatExperience = "Optimized"; - UseMicrosoftECDN = $True; } } } From 3de60a6034f28f9192f7b5f791766e3080acbd77 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Wed, 24 Jan 2024 10:15:39 +0000 Subject: [PATCH 108/122] Fix issue in a few more resources --- CHANGELOG.md | 3 ++- .../MSFT_TeamsAppPermissionPolicy.psm1 | 8 ++++---- .../MSFT_TeamsAppSetupPolicy.psm1 | 9 +++++---- .../MSFT_TeamsCallHoldPolicy.psm1 | 8 ++++---- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 898e4adc8f..153276ee09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,8 @@ * SPOSharingSettings * Fixed an Issue where the MySiteSharingCapability could be returned as an empty string instead of a null value from the Get method. -* TeamsIPPhonePolicy, TeamsMobilityPolicy, TeamsNetworkRoamingPolicy, +* TeamsAppPermissionPolicy, TeamsAppSetupPolicy, TeamsCallHoldPolicy, + TeamsIPPhonePolicy, TeamsMobilityPolicy, TeamsNetworkRoamingPolicy, TeamsShiftsPolicy, TeamsTenantNetworkRegion, TeamsTenantNetworkSite, TeamsTenantNetworkSubnet, TeamsTenantTrustedIPAddress, TeamsTranslationRule, TeamsUnassignedNumberTreatment, TeamsVdiPolicy, TeamsWorkloadPolicy diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppPermissionPolicy/MSFT_TeamsAppPermissionPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppPermissionPolicy/MSFT_TeamsAppPermissionPolicy.psm1 index a80326694c..2b1116f93a 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppPermissionPolicy/MSFT_TeamsAppPermissionPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppPermissionPolicy/MSFT_TeamsAppPermissionPolicy.psm1 @@ -39,7 +39,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -171,7 +171,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -311,7 +311,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -347,7 +347,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppSetupPolicy/MSFT_TeamsAppSetupPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppSetupPolicy/MSFT_TeamsAppSetupPolicy.psm1 index 8f26f01ac4..7d4a44b0b7 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppSetupPolicy/MSFT_TeamsAppSetupPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsAppSetupPolicy/MSFT_TeamsAppSetupPolicy.psm1 @@ -39,7 +39,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -153,7 +153,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -307,10 +307,11 @@ function Test-TargetResource [Parameter()] [System.Boolean] $AllowSideLoading, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -346,7 +347,7 @@ function Test-TargetResource $CurrentValues = Get-TargetResource @PSBoundParameters $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallHoldPolicy/MSFT_TeamsCallHoldPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallHoldPolicy/MSFT_TeamsCallHoldPolicy.psm1 index 35a9a80062..8a4ccd202d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallHoldPolicy/MSFT_TeamsCallHoldPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsCallHoldPolicy/MSFT_TeamsCallHoldPolicy.psm1 @@ -19,7 +19,7 @@ function Get-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -108,7 +108,7 @@ function Set-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -219,7 +219,7 @@ function Test-TargetResource [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] - $Ensure, + $Ensure = 'Present', [Parameter()] [System.Management.Automation.PSCredential] @@ -256,7 +256,7 @@ function Test-TargetResource $ValuesToCheck = ([Hashtable]$PSBoundParameters).Clone() $ValuesToCheck.Remove('Identity') | Out-Null - if ($CurrentValues.Ensure -eq 'Absent') + if ($CurrentValues.Ensure -ne $PSBoundParameters.Ensure) { Write-Verbose -Message "Test-TargetResource returned $false" return $false From 6c8527105de13a7e7f03a26c70978739b6d80d0a Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Wed, 24 Jan 2024 13:02:35 +0000 Subject: [PATCH 109/122] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/teams/TeamsEventsPolicy.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/docs/resources/teams/TeamsEventsPolicy.md b/docs/docs/resources/teams/TeamsEventsPolicy.md index a241b6c24f..d9b751fec2 100644 --- a/docs/docs/resources/teams/TeamsEventsPolicy.md +++ b/docs/docs/resources/teams/TeamsEventsPolicy.md @@ -6,9 +6,17 @@ | --- | --- | --- | --- | --- | | **Identity** | Key | String | Identity of the Teams Events Policy. | | | **Description** | Write | String | Description of the Teams Events Policy. | | +| **AllowEmailEditing** | Write | String | This setting governs if a user is allowed to edit the communication emails in Teams Town Hall or Teams Webinar events. | `Disabled`, `Enabled` | +| **AllowEventIntegrations** | Write | Boolean | This setting governs access to the integrations tab in the event creation workflow. | | | **AllowWebinars** | Write | String | Determines if webinars are allowed by the policy or not. | `Disabled`, `Enabled` | +| **AllowTownhalls** | Write | String | This setting governs if a user can create town halls using Teams Events. | `Disabled`, `Enabled` | +| **AllowedQuestionTypesInRegistrationForm** | Write | String | This setting governs which users in a tenant can add which registration form questions to an event registration page for attendees to answer when registering for the event. | `DefaultOnly`, `DefaultAndPredefinedOnly`, `AllQuestions` | +| **AllowedTownhallTypesForRecordingPublish** | Write | String | This setting describes how IT admins can control which types of Town Hall attendees can have their recordings published. | `None`, `InviteOnly`, `EveryoneInCompanyIncludingGuests`, `Everyone` | +| **AllowedWebinarTypesForRecordingPublish** | Write | String | This setting describes how IT admins can control which types of webinar attendees can have their recordings published. | `None`, `InviteOnly`, `EveryoneInCompanyIncludingGuests`, `Everyone` | | **EventAccessType** | Write | String | Defines who is allowed to join the event. | `Everyone`, `EveryoneInCompanyExcludingGuests` | | **Ensure** | Write | String | Present ensures the policy exists, absent ensures it is removed. | `Present`, `Absent` | +| **TownhallChatExperience** | Write | String | This setting governs whether the user can enable the Comment Stream chat experience for Town Halls. | `Optimized`, `None` | +| **UseMicrosoftECDN** | Write | Boolean | This setting governs whether the global admin disables this property and prevents the organizers from creating town halls that use Microsoft eCDN even though they have been assigned a Teams Premium license. | | | **Credential** | Write | PSCredential | Credentials of the Teams Global Admin. | | | **ApplicationId** | Write | String | Id of the Azure Active Directory application to authenticate with. | | | **TenantId** | Write | String | Name of the Azure Active Directory tenant used for authentication. Format contoso.onmicrosoft.com | | From d46aea86f2484b5afa02962e8ad95d344c03f6d9 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 24 Jan 2024 10:03:41 -0500 Subject: [PATCH 110/122] Fixes Integration --- CHANGELOG.md | 1 + Modules/Microsoft365DSC/Dependencies/Manifest.psd1 | 2 +- .../Resources/EXOApplicationAccessPolicy/1-Create.ps1 | 5 +++-- .../Resources/EXOApplicationAccessPolicy/2-Update.ps1 | 5 +++-- .../EXOAuthenticationPolicyAssignment/1-Create.ps1 | 4 ++-- .../EXOAuthenticationPolicyAssignment/2-Update.ps1 | 6 +++--- .../EXOAuthenticationPolicyAssignment/3-Remove.ps1 | 4 ++-- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb00d07578..03ceb382f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ empty string instead of a null value from the Get method. * DEPENDENCIES * Updated Microsoft.Graph dependencies to version 2.12.0. + * Updated MicrosoftTeams dependencies to version 5.9.0. # 1.24.117.1 diff --git a/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 b/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 index 92ac5bc2ff..ed504505f0 100644 --- a/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 +++ b/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 @@ -82,7 +82,7 @@ }, @{ ModuleName = 'MicrosoftTeams' - RequiredVersion = '5.8.0' + RequiredVersion = '5.9.0' }, @{ ModuleName = "MSCloudLoginAssistant" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 index c88c0ab014..0bbf77f229 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 @@ -13,14 +13,15 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' { - Identity = "Global" + Identity = "Integration Policy" AccessRight = "DenyAccess" AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") - PolicyScopeGroupId = "Engineering Staff" + PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" Description = "Engineering Group Policy" Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 index 54b710aa43..1bc69f306a 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 @@ -13,14 +13,15 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' { - Identity = "Global" + Identity = "Integration Policy" AccessRight = "DenyAccess" AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") - PolicyScopeGroupId = "Engineering Staff" + PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" Description = "Engineering Group Policy Updated" # Updated Property Ensure = "Present" Credential = $Credscredential diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 index 1970482fa3..0fb2f2f613 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/1-Create.ps1 @@ -3,7 +3,7 @@ Configuration Example param( [Parameter(Mandatory = $true)] [PSCredential] - $EXOAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC @@ -14,7 +14,7 @@ Configuration Example UserName = "AdeleV" AuthenticationPolicyName = "Block Basic Auth" Ensure = "Present" - Credential = $EXOAdmin + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 index fca14ac182..95191e3232 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 @@ -3,7 +3,7 @@ Configuration Example param( [Parameter(Mandatory = $true)] [PSCredential] - $EXOAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC @@ -12,9 +12,9 @@ Configuration Example EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' { UserName = "AdeleV" - AuthenticationPolicyName = "Test Policy" + AuthenticationPolicyName = "Test Policy" # Updaqted Property Ensure = "Present" - Credential = $EXOAdmin + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 index aa739f5c3e..becf7194b5 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/3-Remove.ps1 @@ -3,7 +3,7 @@ Configuration Example param( [Parameter(Mandatory = $true)] [PSCredential] - $EXOAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC @@ -14,7 +14,7 @@ Configuration Example UserName = "AdeleV" AuthenticationPolicyName = "Test Policy" Ensure = "Absent" - Credential = $EXOAdmin + Credential = $Credscredential } } } From eb608fb2d6901135b59872e3ced78fabd1ee1e2a Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Wed, 24 Jan 2024 22:55:43 +0000 Subject: [PATCH 111/122] Add description to param in schema --- .../MSFT_TeamsMobilityPolicy.schema.mof | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof index 75a9ae245a..d55b284fda 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof @@ -5,7 +5,7 @@ class MSFT_TeamsMobilityPolicy : OMI_BaseResource [Write, Description("Enables administrators to provide explanatory text about the policy. For example, the Description might indicate the users the policy should be assigned to.")] String Description; [Write, Description("When set to WifiOnly, prohibits the user from making and receiving calls or joining meetings using VoIP calls on the mobile device while on a cellular data connection. Possible values are: WifiOnly, AllNetworks."), ValueMap{"WifiOnly","AllNetworks"}, Values{"WifiOnly","AllNetworks"}] String IPAudioMobileMode; [Write, Description("When set to WifiOnly, prohibits the user from making and receiving video calls or enabling video in meetings using VoIP calls on the mobile device while on a cellular data connection. Possible values are: WifiOnly, AllNetworks."), ValueMap{"WifiOnly","AllNetworks"}, Values{"WifiOnly","AllNetworks"}] String IPVideoMobileMode; - [Write, Description("N/A")] String MobileDialerPreference; + [Write, Description("Determines the mobile dialer preference, possible values are: Teams, Native, UserOverride.")] String MobileDialerPreference; [Write, Description("Present ensures the instance exists, absent ensures it is removed."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; [Write, Description("Credentials of the workload's Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; From 080aac1ad3af91670b0f1fe9332de8a9d16b8c8b Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Wed, 24 Jan 2024 22:58:46 +0000 Subject: [PATCH 112/122] Validate string set on parameter --- CHANGELOG.md | 2 ++ .../MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 | 3 +++ .../MSFT_TeamsMobilityPolicy.schema.mof | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12c63de705..f1b95c8934 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,8 @@ * TeamsMeetingBroadcastPolicy * Fix deletion of resource FIXES [#4231](https://github.com/microsoft/Microsoft365DSC/issues/4231) +* TeamsMobilityPolicy + * Validate string set on parameter MobileDialerPreference * DEPENDENCIES * Updated Microsoft.Graph dependencies to version 2.12.0. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 index 0a9f8ed210..30ff10393e 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.psm1 @@ -24,6 +24,7 @@ function Get-TargetResource [Parameter()] [System.String] + [ValidateSet('Teams', 'Native', 'UserOverride')] $MobileDialerPreference, [Parameter()] @@ -125,6 +126,7 @@ function Set-TargetResource [Parameter()] [System.String] + [ValidateSet('Teams', 'Native', 'UserOverride')] $MobileDialerPreference, [Parameter()] @@ -246,6 +248,7 @@ function Test-TargetResource [Parameter()] [System.String] + [ValidateSet('Teams', 'Native', 'UserOverride')] $MobileDialerPreference, [Parameter()] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof index d55b284fda..30bf8f182c 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsMobilityPolicy/MSFT_TeamsMobilityPolicy.schema.mof @@ -5,7 +5,7 @@ class MSFT_TeamsMobilityPolicy : OMI_BaseResource [Write, Description("Enables administrators to provide explanatory text about the policy. For example, the Description might indicate the users the policy should be assigned to.")] String Description; [Write, Description("When set to WifiOnly, prohibits the user from making and receiving calls or joining meetings using VoIP calls on the mobile device while on a cellular data connection. Possible values are: WifiOnly, AllNetworks."), ValueMap{"WifiOnly","AllNetworks"}, Values{"WifiOnly","AllNetworks"}] String IPAudioMobileMode; [Write, Description("When set to WifiOnly, prohibits the user from making and receiving video calls or enabling video in meetings using VoIP calls on the mobile device while on a cellular data connection. Possible values are: WifiOnly, AllNetworks."), ValueMap{"WifiOnly","AllNetworks"}, Values{"WifiOnly","AllNetworks"}] String IPVideoMobileMode; - [Write, Description("Determines the mobile dialer preference, possible values are: Teams, Native, UserOverride.")] String MobileDialerPreference; + [Write, Description("Determines the mobile dialer preference, possible values are: Teams, Native, UserOverride."), ValueMap{"Teams","Native","UserOverride"}, Values{"Teams","Native","UserOverride"}] String MobileDialerPreference; [Write, Description("Present ensures the instance exists, absent ensures it is removed."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; [Write, Description("Credentials of the workload's Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; From bc55ce25e1b89dd838f2a484ec766b49d8261a07 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Wed, 24 Jan 2024 23:03:06 +0000 Subject: [PATCH 113/122] Update tests --- ...icrosoft365DSC.TeamsMobilityPolicy.Tests.ps1 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 index 95e0e9fc61..746f1aa46b 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 @@ -16,6 +16,7 @@ Import-Module -Name (Join-Path -Path $M365DSCTestFolder ` $Global:DscHelper = New-M365DscUnitTestHelper -StubModule $CmdletModule ` -DscResource 'TeamsMobilityPolicy' -GenericStubModule $GenericStubPath + Describe -Name $Global:DscHelper.DescribeHeader -Fixture { InModuleScope -ModuleName $Global:DscHelper.ModuleName -ScriptBlock { Invoke-Command -ScriptBlock $Global:DscHelper.InitializeScript -NoNewScope @@ -59,7 +60,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'The TeamsMobilityPolicy should exist but it DOES NOT' -Fixture { BeforeAll { $testParams = @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -90,7 +91,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'The TeamsMobilityPolicy exists but it SHOULD NOT' -Fixture { BeforeAll { $testParams = @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -101,7 +102,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-CsTeamsMobilityPolicy -MockWith { return @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -127,7 +128,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'The TeamsMobilityPolicy Exists and Values are already in the desired state' -Fixture { BeforeAll { $testParams = @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -138,7 +139,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-CsTeamsMobilityPolicy -MockWith { return @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -155,7 +156,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'The TeamsMobilityPolicy exists and values are NOT in the desired state' -Fixture { BeforeAll { $testParams = @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -166,7 +167,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-CsTeamsMobilityPolicy -MockWith { return @{ - MobileDialerPreference = 'FakeStringValueDrift #Drift' + MobileDialerPreference = 'Native' Description = 'FakeStringValueDrift #Drift' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' @@ -199,7 +200,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-CsTeamsMobilityPolicy -MockWith { return @{ - MobileDialerPreference = 'FakeStringValue' + MobileDialerPreference = 'Teams' Description = 'FakeStringValue' IPVideoMobileMode = 'AllNetworks' IPAudioMobileMode = 'AllNetworks' From 4fb38e7889598948b419d185d73eb2ddbcc8f626 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Wed, 24 Jan 2024 23:04:37 +0000 Subject: [PATCH 114/122] Remove empty line --- .../Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 index 746f1aa46b..08712766e6 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.TeamsMobilityPolicy.Tests.ps1 @@ -21,7 +21,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { InModuleScope -ModuleName $Global:DscHelper.ModuleName -ScriptBlock { Invoke-Command -ScriptBlock $Global:DscHelper.InitializeScript -NoNewScope BeforeAll { - $secpasswd = ConvertTo-SecureString 'f@kepassword1' -AsPlainText -Force $Credential = New-Object System.Management.Automation.PSCredential ('tenantadmin@mydomain.com', $secpasswd) From e110f34cd9e341e32a5ef3f01207d6a090ba13ff Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Thu, 25 Jan 2024 13:21:09 +0000 Subject: [PATCH 115/122] Search group by its displayname if not found by id --- CHANGELOG.md | 4 ++ .../MSFT_TeamsGroupPolicyAssignment.psm1 | 47 ++++++++++--------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12c63de705..2d4626b442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,10 @@ * TeamsFilesPolicy * Fix condition when resource is absent FIXES [#4225](https://github.com/microsoft/Microsoft365DSC/issues/4225) +* TeamsGroupPolicyAssignment + * Ensure assignment can still be created if GroupId is not found by trying to + search by DisplayName afterwards + FIXES [#4248](https://github.com/microsoft/Microsoft365DSC/issues/4248) * TeamsMeetingBroadcastPolicy * Fix deletion of resource FIXES [#4231](https://github.com/microsoft/Microsoft365DSC/issues/4231) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 index aeeecc7721..5e8e8c7fa8 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 @@ -66,39 +66,44 @@ function Get-TargetResource try { - if (-not [System.String]::IsNullOrEmpty($GroupId)) + Write-Verbose -Message "Getting Group with Id {$GroupId}" + $Group = Find-CsGroup -SearchQuery $GroupId -ExactMatchOnly $true -ErrorAction SilentlyContinue + + if ($null -eq $Group) { - Write-Verbose -Message "Getting GroupPolicyAssignment for {$GroupId}" - $group = Find-CsGroup -SearchQuery $GroupId -ErrorAction SilentlyContinue - if ($group.Length -gt 1) + Write-Verbose -Message "Could not find Group with Id {$GroupId}, searching with DisplayName {$GroupDisplayName}" + $Group = Find-CsGroup -SearchQuery $GroupDisplayName -ExactMatchOnly $true -ErrorAction SilentlyContinue + + if ($null -eq $Group) { - Write-Verbose -Message "Found $($group.Length) groups with the id {$GroupId}" - $Group = $Group | Where-Object { $_.DisplayName -eq $GroupDisplayName } + Write-Verbose -Message "Could not find Group with DisplayName {$GroupDisplayName}" + return $nullReturn } - } - else - { - Write-Verbose -Message "Getting GroupPolicyAssignment for {$GroupDisplayName}" - $Group = Find-CsGroup -SearchQuery $GroupDisplayName -ErrorAction SilentlyContinue - if ($Group.Length -gt 1) + + if ($Group -and $Group.Count -gt 1) { - Write-Verbose -Message "Found $($group.Length) groups with the name $GroupDisplayName" - $Group = $Group | Where-Object { $_.DisplayName -eq $GroupDisplayName } + Write-Verbose -Message "Found $($Group.Count) groups with DisplayName {$GroupDisplayName}" + $Group = $Group | Where-Object -FilterScript { $_.DisplayName -eq $GroupDisplayName } + if ($Group -and $Group.Count -gt 1) + { + Write-Verbose -Message "Still found $($Group.Count) groups with DisplayName {$GroupDisplayName}" + return $nullReturn + } } } - if ($null -eq $Group) - { - Write-Verbose -Message "Group not found for $GroupDisplayName" - return $nullReturn - } + + Write-Verbose -Message "Getting GroupPolicyAssignment with PolicyType {$PolicyType} for Group {$($Group.DisplayName)}" $GroupPolicyAssignment = Get-CsGroupPolicyAssignment -GroupId $Group.Id -PolicyType $PolicyType -ErrorAction SilentlyContinue if ($null -eq $GroupPolicyAssignment) { - Write-Verbose -Message "GroupPolicyAssignment not found for $GroupDisplayName" + Write-Verbose -Message "GroupPolicyAssignment not found for Group $GroupDisplayName" $nullReturn.GroupId = $Group.Id return $nullReturn } - Write-Verbose -Message "Found GroupPolicyAssignment $($Group.Displayname) with PolicyType:$($GroupPolicyAssignment.PolicyType) and Policy Name:$($GroupPolicyAssignment.PolicyName)" + + $Message = "Found GroupPolicyAssignment with PolicyType {$($GroupPolicyAssignment.PolicyType)}, " + ` + "PolicyName {$($GroupPolicyAssignment.PolicyName)} and Priority {$($GroupPolicyAssignment.Priority)} for Group {$($Group.Displayname)}" + Write-Verbose -Message $Message return @{ GroupId = $Group.Id GroupDisplayName = $Group.Displayname From 19cf8b25589b02fd06b3f82f36f759358aa8e82a Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Thu, 25 Jan 2024 13:49:45 +0000 Subject: [PATCH 116/122] Add brackets on message as done everywhere else --- .../MSFT_TeamsGroupPolicyAssignment.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 index 5e8e8c7fa8..3e8ad626f1 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_TeamsGroupPolicyAssignment/MSFT_TeamsGroupPolicyAssignment.psm1 @@ -96,7 +96,7 @@ function Get-TargetResource $GroupPolicyAssignment = Get-CsGroupPolicyAssignment -GroupId $Group.Id -PolicyType $PolicyType -ErrorAction SilentlyContinue if ($null -eq $GroupPolicyAssignment) { - Write-Verbose -Message "GroupPolicyAssignment not found for Group $GroupDisplayName" + Write-Verbose -Message "GroupPolicyAssignment not found for Group {$GroupDisplayName}" $nullReturn.GroupId = $Group.Id return $nullReturn } From 53031acea101686007597219da233fcc9eaac7ed Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 25 Jan 2024 17:09:32 +0000 Subject: [PATCH 117/122] Updated Resources and Cmdlet documentation pages --- docs/docs/resources/teams/TeamsMobilityPolicy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/resources/teams/TeamsMobilityPolicy.md b/docs/docs/resources/teams/TeamsMobilityPolicy.md index ce0f1cfdbf..cf1b238da7 100644 --- a/docs/docs/resources/teams/TeamsMobilityPolicy.md +++ b/docs/docs/resources/teams/TeamsMobilityPolicy.md @@ -8,7 +8,7 @@ | **Description** | Write | String | Enables administrators to provide explanatory text about the policy. For example, the Description might indicate the users the policy should be assigned to. | | | **IPAudioMobileMode** | Write | String | When set to WifiOnly, prohibits the user from making and receiving calls or joining meetings using VoIP calls on the mobile device while on a cellular data connection. Possible values are: WifiOnly, AllNetworks. | `WifiOnly`, `AllNetworks` | | **IPVideoMobileMode** | Write | String | When set to WifiOnly, prohibits the user from making and receiving video calls or enabling video in meetings using VoIP calls on the mobile device while on a cellular data connection. Possible values are: WifiOnly, AllNetworks. | `WifiOnly`, `AllNetworks` | -| **MobileDialerPreference** | Write | String | N/A | | +| **MobileDialerPreference** | Write | String | Determines the mobile dialer preference, possible values are: Teams, Native, UserOverride. | `Teams`, `Native`, `UserOverride` | | **Ensure** | Write | String | Present ensures the instance exists, absent ensures it is removed. | `Present`, `Absent` | | **Credential** | Write | PSCredential | Credentials of the workload's Admin | | | **ApplicationId** | Write | String | Id of the Azure Active Directory application to authenticate with. | | From 39e26702cf17eb26b5ed23cef12410efb1860cb1 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 25 Jan 2024 12:21:48 -0500 Subject: [PATCH 118/122] Ready --- CHANGELOG.md | 4 ++ .../MSFT_EXOApplicationAccessPolicy.psm1 | 56 ++++++++++++++----- .../MSFT_EXODataClassification.psm1 | 12 +--- .../EXOApplicationAccessPolicy/1-Create.ps1 | 2 +- .../EXOApplicationAccessPolicy/2-Update.ps1 | 2 +- .../EXOApplicationAccessPolicy/3-Remove.ps1 | 3 +- .../2-Update.ps1 | 1 + .../EXOClientAccessRule/1-Create.ps1 | 2 +- .../EXOClientAccessRule/2-Update.ps1 | 2 +- .../EXOClientAccessRule/3-Remove.ps1 | 2 +- .../EXODataClassification/1-Create.ps1 | 28 ---------- .../EXODataClassification/2-Update.ps1 | 14 ++--- .../EXODataClassification/3-Remove.ps1 | 28 ---------- 13 files changed, 62 insertions(+), 94 deletions(-) delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/1-Create.ps1 delete mode 100644 Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/3-Remove.ps1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 03ceb382f5..1eea957a3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,10 @@ QueryString and Characteristic parameters. * EXOAddressList * Fixed an issue trying to create a new instance when DisplayName is empty. +* EXOApplicationAccessPolicy + * Changed the logic to retrieve existing instances based on Scope. +* EXODataClassification + * DEPRECATED Resource. * 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_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 index abde1b37c6..7e7915d0af 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 @@ -89,20 +89,45 @@ function Get-TargetResource try { + $ApplicationAccessPolicy = $null try { - $AllApplicationAccessPolicies = Get-ApplicationAccessPolicy -ErrorAction Stop + $ApplicationAccessPolicy = Get-ApplicationAccessPolicy -Identity $Identity -ErrorAction Stop + Write-Verbose -Message "Found policy by Identity {$Identity}" } catch { - if ($_.Exception -like "The operation couldn't be performed because object*") + Write-Verbose -Message "Could not find policy by Identity {$Identity}" + } + + $ScopeIdentityValue = $null + if ($null -eq $ApplicationAccessPolicy) + { + $scopeIdentityGroup = $null + try { - Write-Verbose 'Could not obtain Application Access Policies for Tenant' - return $nullReturn + $scopeIdentityGroup = Get-Group -Identity $PolicyScopeGroupId -ErrorAction Stop + } + catch + { + Write-Verbose -Message "Could not find Group with Identity {$PolicyScopeGroupId}" + } + + if ($null -ne $scopeIdentityGroup) + { + $ScopeIdentityValue = $scopeIdentityGroup.WindowsEmailAddress + $ApplicationAccessPolicy = Get-ApplicationAccessPolicy | Where-Object -FilterScript { $AppID -eq $_.AppId -and $_.ScopeIdentity -eq $scopeIdentityGroup } } - } - $ApplicationAccessPolicy = $AllApplicationAccessPolicies | Where-Object -FilterScript { $_.Identity -eq $Identity } + if ($null -ne $ApplicationAccessPolicy) + { + Write-Verbose -Message "Found Application Access Policy by Scope {$PolicyScopeGroupId}" + } + } + else + { + $ScopeIdentityValue = $ApplicationAccessPolicy.ScopeIdentity + } if ($null -eq $ApplicationAccessPolicy) { @@ -111,11 +136,12 @@ function Get-TargetResource } else { + $ApplicationAccessPolicy = $ApplicationAccessPolicy[0] $result = @{ Identity = $ApplicationAccessPolicy.Identity AccessRight = $ApplicationAccessPolicy.AccessRight AppID = $ApplicationAccessPolicy.AppID - PolicyScopeGroupId = $ApplicationAccessPolicy.ScopeIdentity + PolicyScopeGroupId = $ScopeIdentityValue Description = $ApplicationAccessPolicy.Description Ensure = 'Present' Credential = $Credential @@ -127,7 +153,7 @@ function Get-TargetResource TenantId = $TenantId } - Write-Verbose -Message "Found Application Access Policy $($Identity)" + Write-Verbose -Message "Found Application Access Policy {$($Identity)}" return $result } } @@ -231,7 +257,7 @@ function Set-TargetResource } $SetApplicationAccessPolicyParams = @{ - Identity = $Identity + Identity = $currentApplicationAccessPolicyConfig.Identity Description = $Description Confirm = $false } @@ -253,16 +279,18 @@ function Set-TargetResource # CASE: Application Access Policy exists and it should, but Description attribute has different values than desired (Set-ApplicationAccessPolicy is only able to change description attribute) elseif ($Ensure -eq 'Present' -and $currentApplicationAccessPolicyConfig.Ensure -eq 'Present' -and $currentApplicationAccessPolicyConfig.Description -ne $Description) { - Write-Verbose -Message "Application Access Policy '$($Identity)' already exists, but needs updating." - Write-Verbose -Message "Setting Application Access Policy $($Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $SetApplicationAccessPolicyParams)" + Write-Verbose -Message "Application Access Policy '$($currentApplicationAccessPolicyConfig.Identity)' already exists, but needs updating." + Write-Verbose -Message "Setting Application Access Policy $($currentApplicationAccessPolicyConfig.Identity) with values: $(Convert-M365DscHashtableToString -Hashtable $SetApplicationAccessPolicyParams)" Set-ApplicationAccessPolicy @SetApplicationAccessPolicyParams } # CASE: Application Access Policy exists and it should, but has different values than the desired one # Set-ApplicationAccessPolicy is only able to change description attribute, therefore re-create policy elseif ($Ensure -eq 'Present' -and $currentApplicationAccessPolicyConfig.Ensure -eq 'Present' -and $currentApplicationAccessPolicyConfig.Description -eq $Description) { - Write-Verbose -Message "Re-create Application Access Policy '$($Identity)'" - Remove-ApplicationAccessPolicy -Identity $Identity -Confirm:$false + Write-Verbose -Message "Re-create Application Access Policy '$($currentApplicationAccessPolicyConfig.Identity)'" + Remove-ApplicationAccessPolicy -Identity $currentApplicationAccessPolicyConfig.Identity -Confirm:$false + Write-Verbose -Message "Removing existing policy was successful" + Write-Verbose -Message "Creating new instance with parameters: $(Convert-M365DscHashtableToString -Hashtable $NewApplicationAccessPolicyParams)" New-ApplicationAccessPolicy @NewApplicationAccessPolicyParams } } @@ -354,6 +382,7 @@ function Test-TargetResource $ValuesToCheck.Remove('CertificatePath') | Out-Null $ValuesToCheck.Remove('CertificatePassword') | Out-Null $ValuesToCheck.Remove('ManagedIdentity') | Out-Null + $ValuesToCheck.Remove('Identity') | Out-Null $TestResult = Test-M365DSCParameterState -CurrentValues $CurrentValues ` -Source $($MyInvocation.MyCommand.Source) ` @@ -487,4 +516,3 @@ function Export-TargetResource } Export-ModuleMember -Function *-TargetResource - diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXODataClassification/MSFT_EXODataClassification.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXODataClassification/MSFT_EXODataClassification.psm1 index 620b2c6ee2..6b03e06a7d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXODataClassification/MSFT_EXODataClassification.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXODataClassification/MSFT_EXODataClassification.psm1 @@ -242,19 +242,9 @@ function Set-TargetResource $DataClassificationParams.Remove('CertificatePassword') | Out-Null $DataClassificationParams.Remove('ManagedIdentity') | Out-Null - if (('Present' -eq $Ensure ) -and ($null -eq $DataClassification)) { - Write-Verbose -Message "Creating Data classification policy $($Identity)." - $DataClassificationParams.Remove('Identity') | Out-Null - $DataClassificationParams.Remove('IsDefault') | Out-Null - if (-Not [String]::IsNullOrEmpty($DataClassificationParams.Locale)) - { - $DataClassificationParams.Locale = New-Object system.globalization.cultureinfo($DataClassificationParams.Locale) - } - - New-DataClassification @DataClassificationParams - Write-Verbose -Message 'Data classification policy created successfully.' + Write-Verbose -Message "Data Classification in Exchange Online are now deprecated in favor of Sensitive Information Types in Security and Compliance." } elseif (('Present' -eq $Ensure ) -and ($Null -ne $DataClassification)) { diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 index 0bbf77f229..b7008e86fb 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/1-Create.ps1 @@ -20,7 +20,7 @@ Configuration Example { Identity = "Integration Policy" AccessRight = "DenyAccess" - AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" Description = "Engineering Group Policy" Ensure = "Present" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 index 1bc69f306a..f961e93505 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/2-Update.ps1 @@ -20,7 +20,7 @@ Configuration Example { Identity = "Integration Policy" AccessRight = "DenyAccess" - AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" Description = "Engineering Group Policy Updated" # Updated Property Ensure = "Present" diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 index de77a3afce..cc0936181d 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOApplicationAccessPolicy/3-Remove.ps1 @@ -17,7 +17,8 @@ Configuration Example { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' { - Identity = "Global" + Identity = "Integration Policy" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' Ensure = "Absent" Credential = $Credscredential } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 index 95191e3232..878bf3ebe1 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOAuthenticationPolicyAssignment/2-Update.ps1 @@ -7,6 +7,7 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 index 796c7e53c4..5eb5199ae4 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/1-Create.ps1 @@ -30,7 +30,7 @@ Configuration Example ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $GlobalAdmin + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 index 54c4502dde..023a903f60 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/2-Update.ps1 @@ -30,7 +30,7 @@ Configuration Example ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $GlobalAdmin + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 index 4b4fbfeaf9..42f5cf21c7 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXOClientAccessRule/3-Remove.ps1 @@ -19,7 +19,7 @@ Configuration Example Action = "AllowAccess" Identity = "Always Allow Remote PowerShell" Ensure = "Absent" - Credential = $GlobalAdmin + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/1-Create.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/1-Create.ps1 deleted file mode 100644 index 406907f169..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/1-Create.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXODataClassification 'ConfigureDataClassification' - { - Identity = 'Contoso Confidential' - Name = 'Contoso Confidentiel' - Description = 'Ce message contient des informations confidentielles.' - Locale = 'fr' - IsDefault = $true - Ensure = "Present" - Credential = $Credscredential - } - } -} diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 index 1f4d62384e..c13499914c 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/2-Update.ps1 @@ -16,13 +16,13 @@ Configuration Example { EXODataClassification 'ConfigureDataClassification' { - Identity = 'Contoso Confidential' - Name = 'Contoso Confidentiel' - Description = 'Ce message contient des informations confidentielles. Updated' # Updated Property - Locale = 'fr' - IsDefault = $true - Ensure = "Present" - Credential = $Credscredential + Description = "Detects formatted and unformatted Canadian social insurance number."; + Ensure = "Present"; + Identity = "a2f29c85-ecb8-4514-a610-364790c0773e"; + IsDefault = $True; + Locale = "en-US"; + Name = "Canada Social Insurance Number"; + Credential = $Credscredential } } } diff --git a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/3-Remove.ps1 b/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/3-Remove.ps1 deleted file mode 100644 index 1f4d62384e..0000000000 --- a/Modules/Microsoft365DSC/Examples/Resources/EXODataClassification/3-Remove.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -<# -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. -#> - -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXODataClassification 'ConfigureDataClassification' - { - Identity = 'Contoso Confidential' - Name = 'Contoso Confidentiel' - Description = 'Ce message contient des informations confidentielles. Updated' # Updated Property - Locale = 'fr' - IsDefault = $true - Ensure = "Present" - Credential = $Credscredential - } - } -} From 107d1641c4bf0be44f9819540d3ab963d214bb35 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 25 Jan 2024 12:50:24 -0500 Subject: [PATCH 119/122] Fixes --- .../MSFT_EXOApplicationAccessPolicy.psm1 | 2 +- ...osoft365DSC.EXOApplicationAccessPolicy.Tests.ps1 | 13 ++++--------- .../Microsoft365DSC.EXODataClassification.Tests.ps1 | 3 --- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 index 7e7915d0af..a6c009db0d 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOApplicationAccessPolicy/MSFT_EXOApplicationAccessPolicy.psm1 @@ -92,7 +92,7 @@ function Get-TargetResource $ApplicationAccessPolicy = $null try { - $ApplicationAccessPolicy = Get-ApplicationAccessPolicy -Identity $Identity -ErrorAction Stop + [Array]$ApplicationAccessPolicy = Get-ApplicationAccessPolicy -Identity $Identity -ErrorAction Stop Write-Verbose -Message "Found policy by Identity {$Identity}" } catch diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOApplicationAccessPolicy.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOApplicationAccessPolicy.Tests.ps1 index 8d7b010ff8..f16ed46c56 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOApplicationAccessPolicy.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXOApplicationAccessPolicy.Tests.ps1 @@ -21,6 +21,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Invoke-Command -ScriptBlock $Global:DscHelper.InitializeScript -NoNewScope BeforeAll { + $Script:ExportMode = $false $secpasswd = ConvertTo-SecureString 'test@password1' -AsPlainText -Force $Credential = New-Object System.Management.Automation.PSCredential ('tenantadmin@mydomain.com', $secpasswd) @@ -56,13 +57,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } Mock -CommandName Get-ApplicationAccessPolicy -MockWith { - return @{ - Identity = 'DifferentApplicationAccessPolicy1' - AccessRight = 'DenyAccess' - AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' - ScopeIdentity = 'Engineering Staff' - Description = 'Engineering Group Policy' - } + return $null } Mock -CommandName Set-ApplicationAccessPolicy -MockWith { @@ -101,13 +96,13 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { } Mock -CommandName Get-ApplicationAccessPolicy -MockWith { - return @{ + return @(@{ Identity = 'ApplicationAccessPolicy1' AccessRight = 'DenyAccess' AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' ScopeIdentity = 'Engineering Staff' Description = 'Engineering Group Policy' - } + }) } } diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXODataClassification.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXODataClassification.Tests.ps1 index 38d9729b8f..e2c9b7fe7d 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXODataClassification.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.EXODataClassification.Tests.ps1 @@ -70,7 +70,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It 'Should call the New- cmdlet' { Set-TargetResource @testParams - Should -Invoke -CommandName 'New-DataClassification' -Exactly 1 } } @@ -107,7 +106,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It 'Should set Call into the Set-DataClassification command exactly once' { Set-TargetResource @testParams - Should -Invoke -CommandName 'Set-DataClassification' -Exactly 1 } } @@ -144,7 +142,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { It 'Should call into the Remove-DataClassification cmdlet once' { Set-TargetResource @testParams - Should -Invoke -CommandName 'Remove-DataClassification' -Exactly 1 } } From 0e2d9abb14523eff4eb60c74d7a4d1829c5da63f Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 25 Jan 2024 18:18:28 +0000 Subject: [PATCH 120/122] Updated Resources and Cmdlet documentation pages --- .../exchange/EXOApplicationAccessPolicy.md | 17 +++-- .../EXOAuthenticationPolicyAssignment.md | 15 ++-- .../resources/exchange/EXOClientAccessRule.md | 6 +- .../exchange/EXODataClassification.md | 76 ++----------------- 4 files changed, 28 insertions(+), 86 deletions(-) diff --git a/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md b/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md index 0240a99e8e..5db92e5322 100644 --- a/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md +++ b/docs/docs/resources/exchange/EXOApplicationAccessPolicy.md @@ -54,14 +54,15 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' { - Identity = "Global" + Identity = "Integration Policy" AccessRight = "DenyAccess" - AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") - PolicyScopeGroupId = "Engineering Staff" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' + PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" Description = "Engineering Group Policy" Ensure = "Present" Credential = $Credscredential @@ -86,14 +87,15 @@ Configuration Example ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' { - Identity = "Global" + Identity = "Integration Policy" AccessRight = "DenyAccess" - AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") - PolicyScopeGroupId = "Engineering Staff" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' + PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" Description = "Engineering Group Policy Updated" # Updated Property Ensure = "Present" Credential = $Credscredential @@ -122,7 +124,8 @@ Configuration Example { EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' { - Identity = "Global" + Identity = "Integration Policy" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' Ensure = "Absent" Credential = $Credscredential } diff --git a/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md b/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md index d2a7dc46cb..96b4ec6b82 100644 --- a/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md +++ b/docs/docs/resources/exchange/EXOAuthenticationPolicyAssignment.md @@ -44,7 +44,7 @@ Configuration Example param( [Parameter(Mandatory = $true)] [PSCredential] - $EXOAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC @@ -55,7 +55,7 @@ Configuration Example UserName = "AdeleV" AuthenticationPolicyName = "Block Basic Auth" Ensure = "Present" - Credential = $EXOAdmin + Credential = $Credscredential } } } @@ -70,18 +70,19 @@ Configuration Example param( [Parameter(Mandatory = $true)] [PSCredential] - $EXOAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC + $Domain = $Credscredential.Username.Split('@')[1] node localhost { EXOAuthenticationPolicyAssignment 'ConfigureAuthenticationPolicyAssignment' { UserName = "AdeleV" - AuthenticationPolicyName = "Test Policy" + AuthenticationPolicyName = "Test Policy" # Updaqted Property Ensure = "Present" - Credential = $EXOAdmin + Credential = $Credscredential } } } @@ -96,7 +97,7 @@ Configuration Example param( [Parameter(Mandatory = $true)] [PSCredential] - $EXOAdmin + $Credscredential ) Import-DscResource -ModuleName Microsoft365DSC @@ -107,7 +108,7 @@ Configuration Example UserName = "AdeleV" AuthenticationPolicyName = "Test Policy" Ensure = "Absent" - Credential = $EXOAdmin + Credential = $Credscredential } } } diff --git a/docs/docs/resources/exchange/EXOClientAccessRule.md b/docs/docs/resources/exchange/EXOClientAccessRule.md index 727903391e..57cdcb8a6f 100644 --- a/docs/docs/resources/exchange/EXOClientAccessRule.md +++ b/docs/docs/resources/exchange/EXOClientAccessRule.md @@ -87,7 +87,7 @@ Configuration Example ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $GlobalAdmin + Credential = $Credscredential } } } @@ -126,7 +126,7 @@ Configuration Example ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $GlobalAdmin + Credential = $Credscredential } } } @@ -154,7 +154,7 @@ Configuration Example Action = "AllowAccess" Identity = "Always Allow Remote PowerShell" Ensure = "Absent" - Credential = $GlobalAdmin + Credential = $Credscredential } } } diff --git a/docs/docs/resources/exchange/EXODataClassification.md b/docs/docs/resources/exchange/EXODataClassification.md index 1ad5d66ad4..b477a7473c 100644 --- a/docs/docs/resources/exchange/EXODataClassification.md +++ b/docs/docs/resources/exchange/EXODataClassification.md @@ -58,75 +58,13 @@ Configuration Example { EXODataClassification 'ConfigureDataClassification' { - Identity = 'Contoso Confidential' - Name = 'Contoso Confidentiel' - Description = 'Ce message contient des informations confidentielles.' - Locale = 'fr' - IsDefault = $true - Ensure = "Present" - Credential = $Credscredential - } - } -} -``` - -### Example 2 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXODataClassification 'ConfigureDataClassification' - { - Identity = 'Contoso Confidential' - Name = 'Contoso Confidentiel' - Description = 'Ce message contient des informations confidentielles. Updated' # Updated Property - Locale = 'fr' - IsDefault = $true - Ensure = "Present" - Credential = $Credscredential - } - } -} -``` - -### Example 3 - -This example is used to test new resources and showcase the usage of new resources being worked on. -It is not meant to use as a production baseline. - -```powershell -Configuration Example -{ - param( - [Parameter(Mandatory = $true)] - [PSCredential] - $Credscredential - ) - Import-DscResource -ModuleName Microsoft365DSC - - node localhost - { - EXODataClassification 'ConfigureDataClassification' - { - Identity = 'Contoso Confidential' - Name = 'Contoso Confidentiel' - Description = 'Ce message contient des informations confidentielles. Updated' # Updated Property - Locale = 'fr' - IsDefault = $true - Ensure = "Present" - Credential = $Credscredential + Description = "Detects formatted and unformatted Canadian social insurance number."; + Ensure = "Present"; + Identity = "a2f29c85-ecb8-4514-a610-364790c0773e"; + IsDefault = $True; + Locale = "en-US"; + Name = "Canada Social Insurance Number"; + Credential = $Credscredential } } } From 605a62091beed4c37603bb606c0750c64480dd1b Mon Sep 17 00:00:00 2001 From: NikCharlebois Date: Thu, 25 Jan 2024 18:20:48 +0000 Subject: [PATCH 121/122] Updated {Create} EXO Integration Tests --- .../M365DSCIntegration.EXO.Create.Tests.ps1 | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 index 706d11911a..56c0957ebf 100644 --- a/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 +++ b/Tests/Integration/Microsoft365DSC/M365DSCIntegration.EXO.Create.Tests.ps1 @@ -97,10 +97,10 @@ } EXOApplicationAccessPolicy 'ConfigureApplicationAccessPolicy' { - Identity = "Global" + Identity = "Integration Policy" AccessRight = "DenyAccess" - AppID = @("3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5", "6ac794ca-2697-4137-8754-d2a78ae47d93") - PolicyScopeGroupId = "Engineering Staff" + AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5' + PolicyScopeGroupId = "IntegrationMailEnabled@$Domain" Description = "Engineering Group Policy" Ensure = "Present" Credential = $Credscredential @@ -128,7 +128,7 @@ UserName = "AdeleV" AuthenticationPolicyName = "Block Basic Auth" Ensure = "Present" - Credential = $EXOAdmin + Credential = $Credscredential } EXOAvailabilityAddressSpace 'ConfigureAvailabilityAddressSpace' { @@ -161,17 +161,7 @@ ExceptAnyOfClientIPAddressesOrRanges = @() AnyOfClientIPAddressesOrRanges = @() Ensure = "Present" - Credential = $GlobalAdmin - } - EXODataClassification 'ConfigureDataClassification' - { - Identity = 'Contoso Confidential' - Name = 'Contoso Confidentiel' - Description = 'Ce message contient des informations confidentielles.' - Locale = 'fr' - IsDefault = $true - Ensure = "Present" - Credential = $Credscredential + Credential = $Credscredential } EXODataEncryptionPolicy 'ConfigureDataEncryptionPolicy' { From e1486865083db952e3caee77568bf36472773959 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 25 Jan 2024 13:28:57 -0500 Subject: [PATCH 122/122] Release 1.24.124.1 --- CHANGELOG.md | 2 +- Modules/Microsoft365DSC/Microsoft365DSC.psd1 | 106 ++++++++++++++----- 2 files changed, 83 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bc77153c3..531a56fd91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change log for Microsoft365DSC -# UNRELEASED +# 1.24.124.1 * AADAuthenticationMethodPolicyAuthenticator * Remove the logic path to create a new instance in favor of the update flow. diff --git a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 index 3715c9ef21..4b432876d5 100644 --- a/Modules/Microsoft365DSC/Microsoft365DSC.psd1 +++ b/Modules/Microsoft365DSC/Microsoft365DSC.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 2024-01-17 +# Generated on: 2024-01-25 @{ @@ -11,7 +11,7 @@ # RootModule = '' # Version number of this module. - ModuleVersion = '1.24.117.1' + ModuleVersion = '1.24.124.1' # Supported PSEditions # CompatiblePSEditions = @() @@ -140,32 +140,90 @@ IconUri = 'https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Dependencies/Images/Logo.png?raw=true' # ReleaseNotes of this module - ReleaseNotes = '* AADAdministrativeUnit - * Used generic Graph API URL from MSCloudLoginConnectionProfile. - * AADApplication - * Ignore Permissions in tests if not passed. Preventing null comparison errors. - * AADAttributeSet - * Removed the ability to specify a value of Absent for the Ensure property. + ReleaseNotes = '* AADAuthenticationMethodPolicyAuthenticator + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicyEmail + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicyFido2 + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicySms + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicySoftware + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicyTemporary + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicyVoice + * Remove the logic path to create a new instance in favor of the update flow. + * AADAuthenticationMethodPolicyX509 + * Remove the logic path to create a new instance in favor of the update flow. * AADConditionalAccessPolicy - * Fixes an error where the ApplicationEnforcedRestrictionsIsEnabled parameter - was always set to false in scenarios where it should have been null. - * AADAuthenticationMethodPolicy + * Fix issue when not all parameters are specified + FIXES [[#4202](https://github.com/microsoft/Microsoft365DSC/issues/4202)] + * AADCrossTenantAccessPolicy * Removed the ability to specify a value of Absent for the Ensure property. - * AADAuthenticationMethodPolicyX509 - * Fix the way we returned an empty rule set from the Get method. This caused - the Test-TargetResource method to return true even when instances matched. - * AADRoleSetting + * AADCrossTenantAccessPolicyCOnfigurationDefault * Removed the ability to specify a value of Absent for the Ensure property. - * EXOAntiPhishPolicy - * Add support for HonorDmarcPolicy parameter - FIXES [[#4138](https://github.com/microsoft/Microsoft365DSC/issues/4138)] - * IntuneDeviceConfigurationPolicyMacOS - * Fix CIM instances comparison in Test-TargetResource and export - CompliantAppsList with the correct type - FIXES [#4144](https://github.com/microsoft/Microsoft365DSC/issues/4144) + * AADGroup + * Changed Set logic to restore groups from the deleted list if a match by + DisplayName is found. + * 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. + * EXOApplicationAccessPolicy + * Changed the logic to retrieve existing instances based on Scope. + * EXODataClassification + * DEPRECATED Resource. + * SCAutoSensitivityLabelRule + * Correct export indentation, which caused an issue with report conversion to JSON. + FIXES [[#4240](https://github.com/microsoft/Microsoft365DSC/issues/4240)] + * SPOSharingSettings + * Fixed an Issue where the MySiteSharingCapability could be returned as an + empty string instead of a null value from the Get method. + * TeamsAppPermissionPolicy, TeamsAppSetupPolicy, TeamsCallHoldPolicy, + TeamsIPPhonePolicy, TeamsMobilityPolicy, TeamsNetworkRoamingPolicy, + TeamsShiftsPolicy, TeamsTenantNetworkRegion, TeamsTenantNetworkSite, + TeamsTenantNetworkSubnet, TeamsTenantTrustedIPAddress, TeamsTranslationRule, + TeamsUnassignedNumberTreatment, TeamsVdiPolicy, TeamsWorkloadPolicy + * Fix condition when resource is absent + FIXES [#4227](https://github.com/microsoft/Microsoft365DSC/issues/4227) + * TeamsAudioConferencingPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4215](https://github.com/microsoft/Microsoft365DSC/issues/4215) + * TeamsCallParkPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4210](https://github.com/microsoft/Microsoft365DSC/issues/4210) + * TeamsComplianceRecordingPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4212](https://github.com/microsoft/Microsoft365DSC/issues/4212) + * TeamsCortanaPolicy + * Fix condition in Test-TargetResource when resource is absent + FIXES [#4208](https://github.com/microsoft/Microsoft365DSC/issues/4208) + * TeamsEnhancedEncryptionPolicy + * Fix condition when resource is absent + FIXES [#4221](https://github.com/microsoft/Microsoft365DSC/issues/4221) + * TeamsEventsPolicy + * Add missing attributes + FIXES [#4242](https://github.com/microsoft/Microsoft365DSC/issues/4242) + * TeamsFeedbackPolicy + * Fix condition when resource is absent + FIXES [#4223](https://github.com/microsoft/Microsoft365DSC/issues/4223) + * TeamsFilesPolicy + * Fix condition when resource is absent + FIXES [#4225](https://github.com/microsoft/Microsoft365DSC/issues/4225) + * TeamsGroupPolicyAssignment + * Ensure assignment can still be created if GroupId is not found by trying to + search by DisplayName afterwards + FIXES [#4248](https://github.com/microsoft/Microsoft365DSC/issues/4248) + * TeamsMeetingBroadcastPolicy + * Fix deletion of resource + FIXES [#4231](https://github.com/microsoft/Microsoft365DSC/issues/4231) + * TeamsMobilityPolicy + * Validate string set on parameter MobileDialerPreference * DEPENDENCIES - * Updated Microsoft.PowerApps.Administration.PowerShell to version 2.0.178. - * Updated MSCloudLoginAssistant to version 1.1.6.' + * Updated Microsoft.Graph dependencies to version 2.12.0. + * Updated MicrosoftTeams dependencies to version 5.9.0.' # Flag to indicate whether the module requires explicit user acceptance for install/update # RequireLicenseAcceptance = $false