Skip to content

Commit 66f57ed

Browse files
Update FreeBusyChecker auth flow changes
1 parent 619cc33 commit 66f57ed

8 files changed

Lines changed: 29 additions & 29 deletions

File tree

Diagnostics/FreeBusyChecker/FreeBusyChecker.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ begin {
167167

168168
$Script:ExchangeOnPremLocalDomain = $ADDomain.forest
169169
if ([string]::IsNullOrWhitespace($ADDomain)) {
170-
$Script:ExchangeOnPremLocalDomain = $exchangeOnPremDomain
170+
$Script:ExchangeOnPremLocalDomain = $Script:ExchangeOnPremDomain
171171
}
172172

173-
if ($ExchangeOnPremDomain) {
174-
$Script:FedInfoEOP = Get-federationInformation -DomainName $ExchangeOnPremDomain -BypassAdditionalDomainValidation -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Select-Object *
173+
if ($Script:ExchangeOnPremDomain) {
174+
$Script:FedInfoEOP = Get-federationInformation -DomainName $Script:ExchangeOnPremDomain -BypassAdditionalDomainValidation -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Select-Object *
175175
}
176176
#endregion
177177

@@ -253,10 +253,10 @@ begin {
253253
exit
254254
}
255255
Write-Host " Connected to Exchange Online."
256-
$Script:ExoOrgRel = Get-EOOrganizationRelationship | Where-Object { ($_.DomainNames -like $ExchangeOnPremDomain ) } | Select-Object Enabled, Identity, DomainNames, FreeBusy*, TarGet*
256+
$Script:ExoOrgRel = Get-EOOrganizationRelationship | Where-Object { ($_.DomainNames -like $Script:ExchangeOnPremDomain ) } | Select-Object Enabled, Identity, DomainNames, FreeBusy*, TarGet*
257257
$Script:ExoIntraOrgCon = Get-EOIntraOrganizationConnector | Select-Object Name, TarGetAddressDomains, DiscoveryEndpoint, Enabled
258-
$Script:tarGetAddressPr1 = ("https://AutoDiscover." + $ExchangeOnPremDomain + "/AutoDiscover/AutoDiscover.svc/WSSecurity")
259-
$Script:tarGetAddressPr2 = ("https://" + $ExchangeOnPremDomain + "/AutoDiscover/AutoDiscover.svc/WSSecurity")
258+
$Script:tarGetAddressPr1 = ("https://AutoDiscover." + $Script:ExchangeOnPremDomain + "/AutoDiscover/AutoDiscover.svc/WSSecurity")
259+
$Script:tarGetAddressPr2 = ("https://" + $Script:ExchangeOnPremDomain + "/AutoDiscover/AutoDiscover.svc/WSSecurity")
260260
exoHeaderHtml
261261

262262
#endregion

Diagnostics/FreeBusyChecker/Functions/CommonFunctions.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function Test-ExchangeOnlineConnection {
44
Write-Host -ForegroundColor Green " Checking Exchange Online Configuration"
55
Write-Host " Testing Connection to Exchange Online with EO Prefix."
66
try {
7-
$CheckExoMailbox = get-EOMailbox $Script:UserOnline -ErrorAction Stop
7+
$CheckExoMailbox = Get-EOMailbox $Script:UserOnline -ErrorAction Stop
88
if ($null -ne $CheckExoMailbox) {
99
return $true
1010
} else {

Diagnostics/FreeBusyChecker/Functions/ExoDauthFunctions.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33

44
function ExoOrgRelCheck () {
55
PrintDynamicWidthLine
6-
Write-Host -ForegroundColor Green " Get-EOOrganizationRelationship | Where{($_.DomainNames -like $ExchangeOnPremDomain )} | Select Identity,DomainNames,FreeBusy*,TarGet*,Enabled"
6+
Write-Host -ForegroundColor Green " Get-EOOrganizationRelationship | Where{($_.DomainNames -like $Script:ExchangeOnPremDomain )} | Select Identity,DomainNames,FreeBusy*,TarGet*,Enabled"
77
PrintDynamicWidthLine
88
$ExoOrgRel
99
PrintDynamicWidthLine
1010
Write-Host -ForegroundColor Green " Summary - Organization Relationship"
1111
PrintDynamicWidthLine
1212
Write-Host " Domain Names:"
13-
if ($exoOrgRel.DomainNames -like $ExchangeOnPremDomain) {
14-
Write-Host -ForegroundColor Green " Domain Names Include the $ExchangeOnPremDomain Domain"
13+
if ($exoOrgRel.DomainNames -like $Script:ExchangeOnPremDomain) {
14+
Write-Host -ForegroundColor Green " Domain Names Include the $Script:ExchangeOnPremDomain Domain"
1515
$Script:tdExoOrgRelDomainNames = $exoOrgRel.DomainNames
1616
$Script:tdExoOrgRelDomainNamesColor = "green"
1717
} else {
18-
Write-Host -ForegroundColor Red " Domain Names do Not Include the $ExchangeOnPremDomain Domain"
18+
Write-Host -ForegroundColor Red " Domain Names do Not Include the $Script:ExchangeOnPremDomain Domain"
1919
$exoOrgRel.DomainNames
20-
$Script:tdExoOrgRelDomainNames = "$($exoOrgRel.DomainNames) - Domain Names do Not Include the $ExchangeOnPremDomain Domain"
20+
$Script:tdExoOrgRelDomainNames = "$($exoOrgRel.DomainNames) - Domain Names do Not Include the $Script:ExchangeOnPremDomain Domain"
2121
$Script:tdExoOrgRelDomainNamesColor = "green"
2222
}
2323
#FreeBusyAccessEnabled
@@ -50,7 +50,7 @@ function ExoOrgRelCheck () {
5050
}
5151
#TarGetApplicationUri
5252
Write-Host " TarGetApplicationUri:"
53-
$a = "FYDIBOHF25SPDLT." + $ExchangeOnPremDomain
53+
$a = "FYDIBOHF25SPDLT." + $Script:ExchangeOnPremDomain
5454
$HybridAgentTargetSharingEpr = "http://outlook.office.com/"
5555
$HATargetAutodiscoverEpr = "https://autodiscover-s.outlook.com/autodiscover/autodiscover.svc/"
5656
if ($exoOrgRel.TarGetSharingEpr -like "*resource.mailboxMigration.his.MSAppProxy.net/EWS/Exchange.asmx") {

Diagnostics/FreeBusyChecker/Functions/ExoOauthFunctions.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ function EXOIntraOrgConCheck {
1212
Write-Host -ForegroundColor Green " Summary - Online Intra Organization Connector"
1313
PrintDynamicWidthLine
1414
Write-Host -ForegroundColor White " TarGet Address Domains: "
15-
if ($Script:ExoIntraOrgCon.TarGetAddressDomains -like "*$ExchangeOnpremDomain*") {
15+
if ($Script:ExoIntraOrgCon.TarGetAddressDomains -like "*$Script:ExchangeOnPremDomain*") {
1616
Write-Host -ForegroundColor Green " " $Script:ExoIntraOrgCon.TarGetAddressDomains
1717
$Script:tdExoIntraOrgConTarGetAddressDomains = $Script:ExoIntraOrgCon.TarGetAddressDomains
1818
$Script:tdExoIntraOrgConTarGetAddressDomainsColor = "green"
1919
} else {
2020
Write-Host -ForegroundColor Red " TarGet Address Domains is NOT correct."
21-
Write-Host -ForegroundColor White " Should contain the $ExchangeOnpremDomain"
22-
$Script:tdExoIntraOrgConTarGetAddressDomains = " $($Script:ExoIntraOrgCon.TarGetAddressDomains) . Should contain the $ExchangeOnpremDomain"
21+
Write-Host -ForegroundColor White " Should contain the $Script:ExchangeOnPremDomain"
22+
$Script:tdExoIntraOrgConTarGetAddressDomains = " $($Script:ExoIntraOrgCon.TarGetAddressDomains) . Should contain the $Script:ExchangeOnPremDomain"
2323
$Script:tdExoIntraOrgConTarGetAddressDomainsColor = "red"
2424
}
2525
Write-Host -ForegroundColor White " DiscoveryEndpoint: "
@@ -56,20 +56,20 @@ function EXOIntraOrgConCheck {
5656
function EXOIntraOrgConfigCheck {
5757
Write-Host -ForegroundColor Green " Get-IntraOrganizationConfiguration | Select OnPremiseTarGetAddresses"
5858
PrintDynamicWidthLine
59-
$Script:ExoIntraOrgConfig = Get-EOOnPremisesOrganization | Select-Object OrganizationGuid | Get-EOIntraOrganizationConfiguration | Select-Object * | Where-Object { $_.OnPremiseTarGetAddresses -like "*$ExchangeOnPremDomain*" }
59+
$Script:ExoIntraOrgConfig = Get-EOOnPremisesOrganization | Select-Object OrganizationGuid | Get-EOIntraOrganizationConfiguration | Select-Object * | Where-Object { $_.OnPremiseTarGetAddresses -like "*$Script:ExchangeOnPremDomain*" }
6060
$IOConfig = $Script:ExoIntraOrgConfig | Format-List
6161
$IOConfig
6262
PrintDynamicWidthLine
6363
Write-Host -ForegroundColor Green " Summary - Exchange Online Intra Organization Configuration"
6464
PrintDynamicWidthLine
6565
Write-Host -ForegroundColor White " OnPremiseTarGetAddresses: "
66-
if ($Script:ExoIntraOrgConfig.OnPremiseTarGetAddresses -like "*$ExchangeOnpremDomain*") {
66+
if ($Script:ExoIntraOrgConfig.OnPremiseTarGetAddresses -like "*$Script:ExchangeOnPremDomain*") {
6767
Write-Host -ForegroundColor Green " " $Script:ExoIntraOrgConfig.OnPremiseTarGetAddresses
6868
$Script:tdExoIntraOrgConfigOnPremiseTarGetAddresses = $Script:ExoIntraOrgConfig.OnPremiseTarGetAddresses
6969
$Script:tdExoIntraOrgConfigOnPremiseTarGetAddressesColor = "green"
7070
} else {
7171
Write-Host -ForegroundColor Red " OnPremise TarGet Addresses are NOT correct."
72-
Write-Host -ForegroundColor White " Should contain the $ExchangeOnpremDomain"
72+
Write-Host -ForegroundColor White " Should contain the $Script:ExchangeOnPremDomain"
7373
$Script:tdExoIntraOrgConfigOnPremiseTarGetAddresses = $Script:ExoIntraOrgConfig.OnPremiseTarGetAddresses
7474
$Script:tdExoIntraOrgConfigOnPremiseTarGetAddressesColor = "red"
7575
}

Diagnostics/FreeBusyChecker/Functions/OnPremDAuthFunctions.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function FedTrustCheck {
204204
PrintDynamicWidthLine
205205
$CurrentTime = Get-Date
206206
Write-Host -ForegroundColor White " Federation Trust Application Uri:"
207-
if ($FedTrust.ApplicationUri -like "FYDIBOHF25SPDLT.$ExchangeOnpremDomain") {
207+
if ($FedTrust.ApplicationUri -like "FYDIBOHF25SPDLT.$Script:ExchangeOnPremDomain") {
208208
Write-Host -ForegroundColor Green " " $FedTrust.ApplicationUri
209209
$Script:tdFedTrustApplicationUriColor = "green"
210210
$Script:tdFedTrustApplicationUriFL = $FedTrust.ApplicationUri

Diagnostics/FreeBusyChecker/Functions/OnPremOAuthFunctions.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ function PartnerApplicationCheck {
165165
$Script:tdPartnerApplicationRealm = "Should be Blank"
166166
}
167167
Write-Host -ForegroundColor White " LinkedAccount: "
168-
if ($PartnerApplication.LinkedAccount -like "$exchangeOnPremDomain/Users/Exchange Online-ApplicationAccount" -or $PartnerApplication.LinkedAccount -like "$Script:ExchangeOnPremLocalDomain/Users/Exchange Online-ApplicationAccount" ) {
168+
if ($PartnerApplication.LinkedAccount -like "$Script:ExchangeOnPremDomain/Users/Exchange Online-ApplicationAccount" -or $PartnerApplication.LinkedAccount -like "$Script:ExchangeOnPremLocalDomain/Users/Exchange Online-ApplicationAccount" ) {
169169
Write-Host -ForegroundColor Green " " $PartnerApplication.LinkedAccount
170170
$Script:tdPartnerApplicationLinkedAccountColor = "green"
171171
} else {

Diagnostics/FreeBusyChecker/Functions/hostOutput.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ function ShowParameters() {
5858
Write-Host -ForegroundColor White " AD root Domain"
5959
Write-Host -ForegroundColor Green " $Script:ExchangeOnPremLocalDomain"
6060
Write-Host -ForegroundColor White " Exchange On Premises Domain: "
61-
Write-Host -ForegroundColor Green " $exchangeOnPremDomain"
61+
Write-Host -ForegroundColor Green " $Script:ExchangeOnPremDomain"
6262
Write-Host -ForegroundColor White " Exchange On Premises External EWS url:"
63-
Write-Host -ForegroundColor Green " $exchangeOnPremEWS"
63+
Write-Host -ForegroundColor Green " $Script:ExchangeOnPremEWS"
6464
Write-Host -ForegroundColor White " On Premises Hybrid Mailbox:"
6565
Write-Host -ForegroundColor Green " $Script:UserOnPrem"
6666
Write-Host -ForegroundColor White " Exchange Online Mailbox:"

Diagnostics/FreeBusyChecker/Functions/htmlContent.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ margin-right: 1%;
103103
</li>
104104
<li>
105105
<p>Exchange On Premises Domain:</p>
106-
<span style='color:green; font-weight:500; padding-left:2%'>$exchangeOnPremDomain</span>
106+
<span style='color:green; font-weight:500; padding-left:2%'>$Script:ExchangeOnPremDomain</span>
107107
</li>
108108
<li>
109109
<p>Exchange On Premises External EWS url:</p>
110-
<span style='color:green; font-weight:500; padding-left:2%'>$exchangeOnPremEWS</span>
110+
<span style='color:green; font-weight:500; padding-left:2%'>$Script:ExchangeOnPremEWS</span>
111111
</li>
112112
<li>
113113
<p>On Premises Hybrid Mailbox:</p>
@@ -173,7 +173,7 @@ function FedInfoHtml() {
173173
<th ColSpan='2' style='color:white;'>Summary - Get-FederationInformation</th>
174174
</tr>
175175
<tr>
176-
<td><b>Get-FederationInformation -Domain $ExchangeOnPremDomain</b></td>
176+
<td><b>Get-FederationInformation -Domain $Script:ExchangeOnPremDomain</b></td>
177177
<td>
178178
<div> <b>Domain Names: </b> <span style='color:$tdDomainNamesColor'>$tdDomainNamesFL</span></div>
179179
<div> <b>TokenIssuerUris: </b> <span style='color:$tdTokenIssuerUrisColor'>$tdTokenIssuerUrisFL</span></div>
@@ -538,13 +538,13 @@ function AvailabilityAddressSpaceCheckOAuth() {
538538
$Script:tdAvailabilityAddressSpaceAccessMethodColor = "red"
539539
}
540540
Write-Host -ForegroundColor White " ProxyUrl: "
541-
if ($AvailabilityAddressSpace.ProxyUrl -like $exchangeOnPremEWS) {
541+
if ($AvailabilityAddressSpace.ProxyUrl -like $Script:ExchangeOnPremEWS) {
542542
Write-Host -ForegroundColor Green " "$AvailabilityAddressSpace.ProxyUrl
543543
$Script:tdAvailabilityAddressSpaceProxyUrl = $AvailabilityAddressSpace.ProxyUrl
544544
$Script:tdAvailabilityAddressSpaceProxyUrlColor = "green"
545545
} else {
546546
Write-Host -ForegroundColor Red " ProxyUrl is NOT correct. "
547-
Write-Host -ForegroundColor White " Should be $exchangeOnPremEWS"
547+
Write-Host -ForegroundColor White " Should be $Script:ExchangeOnPremEWS"
548548
$Script:tdAvailabilityAddressSpaceProxyUrl = $AvailabilityAddressSpace.ProxyUrl
549549
$Script:tdAvailabilityAddressSpaceProxyUrlColor = "red"
550550
}
@@ -653,7 +653,7 @@ function ExoOrgRelCheckHtml() {
653653
<th ColSpan='2' style='color:white;'>Summary - Get-OrganizationRelationship</th>
654654
</tr>
655655
<tr>
656-
<td><b> Get-OrganizationRelationship | Where{($_.DomainNames -like $ExchangeOnPremDomain )} | Select Identity,DomainNames,FreeBusy*,TarGet*,Enabled</b></td>
656+
<td><b> Get-OrganizationRelationship | Where{($_.DomainNames -like $Script:ExchangeOnPremDomain )} | Select Identity,DomainNames,FreeBusy*,TarGet*,Enabled</b></td>
657657
<td>
658658
<div><b>Domain Names:</b><span >$($Script:tdExoOrgRelDomainNamesData)</span></div>
659659
<div><b>FreeBusyAccessEnabled:</b><span style='color:$Script:tdExoOrgRelFreeBusyAccessEnabledColor'>$($Script:tdExoOrgRelFreeBusyAccessEnabled)</span></div>

0 commit comments

Comments
 (0)