Skip to content

Commit 666e9f2

Browse files
Update Diagnostics/FreeBusyChecker/Functions/CommonFunctions.ps1
Suggestion accepted Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a7d9c0a commit 666e9f2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Diagnostics/FreeBusyChecker/Functions/CommonFunctions.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ function FetchEWSInformation {
2424
if (-not $Script:WebServicesVirtualDirectory -or -not $Script:WebServicesVirtualDirectoryOAuth) {
2525
$Script:WebServicesVirtualDirectory = Get-WebServicesVirtualDirectory -Server $Script:Server | Select-Object Identity, Name, ExchangeVersion, *Authentication*, *url -ErrorAction SilentlyContinue
2626
$Script:WebServicesVirtualDirectoryOAuth = $Script:WebServicesVirtualDirectory
27+
28+
if ([string]::IsNullOrWhiteSpace($Script:ExchangeOnPremEWS)) {
29+
$externalUrl = $Script:WebServicesVirtualDirectory |
30+
Where-Object { $null -ne $_.ExternalUrl } |
31+
Select-Object -First 1 -ExpandProperty ExternalUrl
32+
33+
if ($null -ne $externalUrl) {
34+
$Script:ExchangeOnPremEWS = $externalUrl.ToString()
35+
}
36+
}
2737
}
2838
}
2939
function CheckIfExchangeServer {

0 commit comments

Comments
 (0)