From af88962be3d08c9fe09f6b3edfb58b06fc834744 Mon Sep 17 00:00:00 2001 From: MrBookie7 Date: Tue, 18 Mar 2025 11:31:23 -0700 Subject: [PATCH 1/2] adds OAuthAuthentication property --- CHANGELOG.md | 7 ++++++ README.md | 2 ++ .../DSC_ExchEcpVirtualDirectory.psm1 | 23 +++++++++++++++++++ .../DSC_ExchEcpVirtualDirectory.schema.mof | 1 + .../DSC_ExchOwaVirtualDirectory.psm1 | 22 ++++++++++++++++++ .../DSC_ExchOwaVirtualDirectory.schema.mof | 1 + ...hEcpVirtualDirectory.Integration.Tests.ps1 | 6 +++++ ...hOwaVirtualDirectory.Integration.Tests.ps1 | 6 +++++ .../DSC_ExchEcpVirtualDirectory.tests.ps1 | 1 + .../DSC_ExchOwaVirtualDirectory.tests.ps1 | 1 + 10 files changed, 70 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d21a6af..c728ddbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- ExchEcpVirtualDirectory + - Added parameter `OAuthAuthentication` +- ExchOwaVirtualDirectory + - Added parameter `OAuthAuthentication` + ## [2.0.0] - 2023-04-19 ### Changed diff --git a/README.md b/README.md index 444d12de..f4ed6483 100644 --- a/README.md +++ b/README.md @@ -432,6 +432,7 @@ parameters. - **GzipLevel** - **ExternalUrl** - **InternalUrl** +- **OAuthAuthentication** - **WindowsAuthentication** - **WSSecurityAuthentication** @@ -1476,6 +1477,7 @@ parameters. - **InstantMessagingType** - **LogonPagePublicPrivateSelectionEnabled** - **LogonPageLightSelectionEnabled** +- **OAuthAuthentication** - **UNCAccessOnPublicComputersEnabled** - **UNCAccessOnPrivateComputersEnabled** - **WindowsAuthentication** diff --git a/source/DSCResources/DSC_ExchEcpVirtualDirectory/DSC_ExchEcpVirtualDirectory.psm1 b/source/DSCResources/DSC_ExchEcpVirtualDirectory/DSC_ExchEcpVirtualDirectory.psm1 index 2e987e40..ae4fc6c4 100644 --- a/source/DSCResources/DSC_ExchEcpVirtualDirectory/DSC_ExchEcpVirtualDirectory.psm1 +++ b/source/DSCResources/DSC_ExchEcpVirtualDirectory/DSC_ExchEcpVirtualDirectory.psm1 @@ -138,6 +138,10 @@ function Get-TargetResource [System.String] $InternalUrl, + [Parameter()] + [System.Boolean] + $OAuthAuthentication, + [Parameter()] [System.Boolean] $OwaOptionsEnabled, @@ -172,6 +176,7 @@ function Get-TargetResource FormsAuthentication = [System.Boolean] $EcpVdir.FormsAuthentication GzipLevel = [System.String] $EcpVdir.GzipLevel InternalUrl = [System.String] $EcpVdir.InternalUrl + OAuthAuthentication = [System.Boolean] $EcpVdir.OAuthAuthentication WindowsAuthentication = [System.Boolean] $EcpVdir.WindowsAuthentication OwaOptionsEnabled = [System.Boolean] $EcpVdir.OwaOptionsEnabled } @@ -318,6 +323,10 @@ function Set-TargetResource [System.String] $InternalUrl, + [Parameter()] + [System.Boolean] + $OAuthAuthentication, + [Parameter()] [System.Boolean] $OwaOptionsEnabled, @@ -501,6 +510,10 @@ function Test-TargetResource [System.String] $InternalUrl, + [Parameter()] + [System.Boolean] + $OAuthAuthentication, + [Parameter()] [System.Boolean] $OwaOptionsEnabled, @@ -581,10 +594,16 @@ function Test-TargetResource { $testResults = $false } + if (!(Test-ExchangeSetting -Name 'OwaOptionsEnabled' -Type 'Boolean' -ExpectedValue $OwaOptionsEnabled -ActualValue $EcpVdir.OwaOptionsEnabled -PSBoundParametersIn $PSBoundParameters -Verbose:$VerbosePreference)) { $testResults = $false } + + if (!(Test-ExchangeSetting -Name 'OAuthAuthentication' -Type 'Boolean' -ExpectedValue $OAuthAuthentication -ActualValue $EcpVdir.OAuthAuthentication -PSBoundParametersIn $PSBoundParameters -Verbose:$VerbosePreference)) + { + $testResults = $false + } } return $testResults @@ -731,6 +750,10 @@ function Get-EcpVirtualDirectoryInternal [System.String] $InternalUrl, + [Parameter()] + [System.Boolean] + $OAuthAuthentication, + [Parameter()] [System.Boolean] $OwaOptionsEnabled, diff --git a/source/DSCResources/DSC_ExchEcpVirtualDirectory/DSC_ExchEcpVirtualDirectory.schema.mof b/source/DSCResources/DSC_ExchEcpVirtualDirectory/DSC_ExchEcpVirtualDirectory.schema.mof index 10c70b50..0f864f56 100644 --- a/source/DSCResources/DSC_ExchEcpVirtualDirectory/DSC_ExchEcpVirtualDirectory.schema.mof +++ b/source/DSCResources/DSC_ExchEcpVirtualDirectory/DSC_ExchEcpVirtualDirectory.schema.mof @@ -17,6 +17,7 @@ class DSC_ExchEcpVirtualDirectory : OMI_BaseResource [Write, Description("The GzipLevel parameter sets Gzip configuration information for the ECP virtual directory."), ValueMap{"Off", "Low", "High", "Error"}, Values{"Off", "Low", "High", "Error"}] String GzipLevel; [Write, Description("The ExternalURL parameter specifies the URL that's used to connect to the virtual directory from outside the firewall.")] String ExternalUrl; [Write, Description("The InternalURL parameter specifies the URL that's used to connect to the virtual directory from inside the firewall.")] String InternalUrl; + [Write, Description("The OAuthAuthentication parameter specifies whether OAuth authentication is enabled on the virtual directory. ")] Boolean OAuthAuthentication; [Write, Description("Specifies that Outlook on the web Options is enabled for end users.")] Boolean OwaOptionsEnabled; [Write, Description("The WindowsAuthentication parameter specifies whether Integrated Windows authentication is enabled on the virtual directory.")] Boolean WindowsAuthentication; }; diff --git a/source/DSCResources/DSC_ExchOwaVirtualDirectory/DSC_ExchOwaVirtualDirectory.psm1 b/source/DSCResources/DSC_ExchOwaVirtualDirectory/DSC_ExchOwaVirtualDirectory.psm1 index ac9cd62a..bf319267 100644 --- a/source/DSCResources/DSC_ExchOwaVirtualDirectory/DSC_ExchOwaVirtualDirectory.psm1 +++ b/source/DSCResources/DSC_ExchOwaVirtualDirectory/DSC_ExchOwaVirtualDirectory.psm1 @@ -97,6 +97,10 @@ function Get-TargetResource [System.Boolean] $LogonPageLightSelectionEnabled, + [Parameter()] + [System.Boolean] + $OAuthAuthentication, + [Parameter()] [System.Boolean] $UNCAccessOnPublicComputersEnabled, @@ -164,6 +168,7 @@ function Get-TargetResource LogonFormat = [System.String] $OwaVdir.LogonFormat LogonPageLightSelectionEnabled = [System.Boolean] $OwaVdir.LogonPageLightSelectionEnabled LogonPagePublicPrivateSelectionEnabled = [System.Boolean] $OwaVdir.LogonPagePublicPrivateSelectionEnabled + OAuthAuthentication = [System.Boolean] $OwaVdir.OAuthAuthentication UNCAccessOnPublicComputersEnabled = [System.Boolean] $OwaVdir.UNCAccessOnPublicComputersEnabled UNCAccessOnPrivateComputersEnabled = [System.Boolean] $OwaVdir.UNCAccessOnPrivateComputersEnabled WindowsAuthentication = [System.Boolean] $OwaVdir.WindowsAuthentication @@ -272,6 +277,10 @@ function Set-TargetResource [System.Boolean] $LogonPageLightSelectionEnabled, + [Parameter()] + [System.Boolean] + $OAuthAuthentication, + [Parameter()] [System.Boolean] $UNCAccessOnPublicComputersEnabled, @@ -431,6 +440,10 @@ function Test-TargetResource [System.Boolean] $LogonPageLightSelectionEnabled, + [Parameter()] + [System.Boolean] + $OAuthAuthentication, + [Parameter()] [System.Boolean] $UNCAccessOnPublicComputersEnabled, @@ -616,6 +629,11 @@ function Test-TargetResource { $testResults = $false } + + if (!(Test-ExchangeSetting -Name 'OAuthAuthentication' -Type 'Boolean' -ExpectedValue $OAuthAuthentication -ActualValue $OwaVdir.OAuthAuthentication -PSBoundParametersIn $PSBoundParameters -Verbose:$VerbosePreference)) + { + $testResults = $false + } } return $testResults @@ -718,6 +736,10 @@ function Get-OwaVirtualDirectoryInternal [System.Boolean] $LogonPageLightSelectionEnabled, + [Parameter()] + [System.Boolean] + $OAuthAuthentication, + [Parameter()] [System.Boolean] $UNCAccessOnPublicComputersEnabled, diff --git a/source/DSCResources/DSC_ExchOwaVirtualDirectory/DSC_ExchOwaVirtualDirectory.schema.mof b/source/DSCResources/DSC_ExchOwaVirtualDirectory/DSC_ExchOwaVirtualDirectory.schema.mof index 4b7f83f2..a15e56ab 100644 --- a/source/DSCResources/DSC_ExchOwaVirtualDirectory/DSC_ExchOwaVirtualDirectory.schema.mof +++ b/source/DSCResources/DSC_ExchOwaVirtualDirectory/DSC_ExchOwaVirtualDirectory.schema.mof @@ -26,6 +26,7 @@ class DSC_ExchOwaVirtualDirectory : OMI_BaseResource [Write, ValueMap{"None", "Ocs"}, Values{"None", "Ocs"}] String InstantMessagingType; [Write] Boolean LogonPagePublicPrivateSelectionEnabled; [Write] Boolean LogonPageLightSelectionEnabled; + [Write] Boolean OAuthAuthentication; [Write] Boolean UNCAccessOnPublicComputersEnabled; [Write] Boolean UNCAccessOnPrivateComputersEnabled; [Write] Boolean WindowsAuthentication; diff --git a/tests/Integration/DSC_ExchEcpVirtualDirectory.Integration.Tests.ps1 b/tests/Integration/DSC_ExchEcpVirtualDirectory.Integration.Tests.ps1 index be42747b..1f898758 100644 --- a/tests/Integration/DSC_ExchEcpVirtualDirectory.Integration.Tests.ps1 +++ b/tests/Integration/DSC_ExchEcpVirtualDirectory.Integration.Tests.ps1 @@ -43,6 +43,7 @@ if ($exchangeInstalled) FormsAuthentication = $true GzipLevel = 'Off' InternalUrl = "https://$($serverFqdn)/ecp" + OAuthAuthentication = $false WindowsAuthentication = $false } @@ -55,6 +56,7 @@ if ($exchangeInstalled) FormsAuthentication = $true GzipLevel = 'Off' InternalUrl = "https://$($serverFqdn)/ecp" + OAuthAuthentication = $false WindowsAuthentication = $false } @@ -72,6 +74,7 @@ if ($exchangeInstalled) FormsAuthentication = $false GzipLevel = 'High' InternalUrl = '' + OAuthAuthentication = $true WindowsAuthentication = $true } @@ -84,6 +87,7 @@ if ($exchangeInstalled) FormsAuthentication = $false GzipLevel = 'High' InternalUrl = '' + OAuthAuthentication = $true WindowsAuthentication = $true } @@ -98,6 +102,7 @@ if ($exchangeInstalled) BasicAuthentication = $true DigestAuthentication = $false FormsAuthentication = $true + OAuthAuthentication = $false WindowsAuthentication = $false } @@ -106,6 +111,7 @@ if ($exchangeInstalled) BasicAuthentication = $true DigestAuthentication = $false FormsAuthentication = $true + OAuthAuthentication = $false WindowsAuthentication = $false } diff --git a/tests/Integration/DSC_ExchOwaVirtualDirectory.Integration.Tests.ps1 b/tests/Integration/DSC_ExchOwaVirtualDirectory.Integration.Tests.ps1 index d9d1e639..f321d0a2 100644 --- a/tests/Integration/DSC_ExchOwaVirtualDirectory.Integration.Tests.ps1 +++ b/tests/Integration/DSC_ExchOwaVirtualDirectory.Integration.Tests.ps1 @@ -70,6 +70,7 @@ if ($exchangeInstalled) InternalUrl = "https://$($serverFqdn)/owa" LogonPagePublicPrivateSelectionEnabled = $true LogonPageLightSelectionEnabled = $true + OAuthAuthentication = $false UNCAccessOnPublicComputersEnabled = $true UNCAccessOnPrivateComputersEnabled = $true WindowsAuthentication = $false @@ -98,6 +99,7 @@ if ($exchangeInstalled) InternalUrl = "https://$($serverFqdn)/owa" LogonPagePublicPrivateSelectionEnabled = $true LogonPageLightSelectionEnabled = $true + OAuthAuthentication = $false UNCAccessOnPublicComputersEnabled = $true UNCAccessOnPrivateComputersEnabled = $true WindowsAuthentication = $false @@ -130,6 +132,7 @@ if ($exchangeInstalled) InternalUrl = '' LogonPagePublicPrivateSelectionEnabled = $false LogonPageLightSelectionEnabled = $false + OAuthAuthentication = $true UNCAccessOnPublicComputersEnabled = $false UNCAccessOnPrivateComputersEnabled = $false WindowsAuthentication = $true @@ -158,6 +161,7 @@ if ($exchangeInstalled) InternalUrl = '' LogonPagePublicPrivateSelectionEnabled = $false LogonPageLightSelectionEnabled = $false + OAuthAuthentication = $true UNCAccessOnPublicComputersEnabled = $false UNCAccessOnPrivateComputersEnabled = $false WindowsAuthentication = $true @@ -178,6 +182,7 @@ if ($exchangeInstalled) BasicAuthentication = $true DigestAuthentication = $false FormsAuthentication = $true + OAuthAuthentication = $false WindowsAuthentication = $false } @@ -186,6 +191,7 @@ if ($exchangeInstalled) BasicAuthentication = $true DigestAuthentication = $false FormsAuthentication = $true + OAuthAuthentication = $false WindowsAuthentication = $false } diff --git a/tests/Unit/DSC_ExchEcpVirtualDirectory.tests.ps1 b/tests/Unit/DSC_ExchEcpVirtualDirectory.tests.ps1 index 50adb745..1f72f97f 100644 --- a/tests/Unit/DSC_ExchEcpVirtualDirectory.tests.ps1 +++ b/tests/Unit/DSC_ExchEcpVirtualDirectory.tests.ps1 @@ -38,6 +38,7 @@ try FormsAuthentication = [System.Boolean] $false GzipLevel = [System.String] '' InternalUrl = [System.String] '' + OAuthAuthentication = [System.Boolean] $false WindowsAuthentication = [System.Boolean] $false OwaOptionsEnabled = [System.Boolean] $false } diff --git a/tests/Unit/DSC_ExchOwaVirtualDirectory.tests.ps1 b/tests/Unit/DSC_ExchOwaVirtualDirectory.tests.ps1 index 15b52282..35bb8408 100644 --- a/tests/Unit/DSC_ExchOwaVirtualDirectory.tests.ps1 +++ b/tests/Unit/DSC_ExchOwaVirtualDirectory.tests.ps1 @@ -46,6 +46,7 @@ try LogonFormat = [System.String] '' LogonPageLightSelectionEnabled = [System.Boolean] $false LogonPagePublicPrivateSelectionEnabled = [System.Boolean] $false + OAuthAuthentication = [System.Boolean] $false UNCAccessOnPublicComputersEnabled = [System.Boolean] $false UNCAccessOnPrivateComputersEnabled = [System.Boolean] $false WindowsAuthentication = [System.Boolean] $false From 37951bba8e22d0b52517941fa5ea4453e0aa87b6 Mon Sep 17 00:00:00 2001 From: MrBookie7 Date: Wed, 19 Mar 2025 10:55:55 -0700 Subject: [PATCH 2/2] fix azure-pipelines.yml version of GitVersion.Tool --- CHANGELOG.md | 5 +++++ azure-pipelines.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c728ddbb..7adc04e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ExchOwaVirtualDirectory - Added parameter `OAuthAuthentication` +### Fixed + +- azure-pipelines.yml + - Specified version of GitVersion.Tool to use 5.* + ## [2.0.0] - 2023-04-19 ### Changed diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f895bb1c..1f564434 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,7 +29,7 @@ stages: vmImage: 'windows-latest' steps: - pwsh: | - dotnet tool install --global GitVersion.Tool + dotnet tool install --global GitVersion.Tool --version 5.* $gitVersionObject = dotnet-gitversion | ConvertFrom-Json $gitVersionObject.PSObject.Properties.ForEach{ Write-Host -Object "Setting Task Variable '$($_.Name)' with value '$($_.Value)'."