Complete the HMA implementation by fully disabling legacy authentication methods and validating that all clients are using modern authentication. This step maximizes security benefits.
Disable basic authentication on Autodiscover (final step):
Get-AutodiscoverVirtualDirectory | Set-AutodiscoverVirtualDirectory -BasicAuthEnabled $false -WindowsAuthentication $false
Create an authentication policy to block legacy authentication:
New-AuthenticationPolicy -Name "Block Legacy Auth" -AllowBasicAuthActiveSync:$false -AllowBasicAuthAutodiscover:$false -AllowBasicAuthImap:$false -AllowBasicAuthMapi:$false -AllowBasicAuthOfflineAddressBook:$false -AllowBasicAuthOutlookService:$false -AllowBasicAuthPop:$false -AllowBasicAuthPowershell:$false -AllowBasicAuthReportingWebServices:$false -AllowBasicAuthRest:$false -AllowBasicAuthRpc:$false -AllowBasicAuthSmtp:$false -AllowBasicAuthWebServices:$false
Apply the authentication policy to all mailboxes:
Get-Mailbox -ResultSize Unlimited | Set-Mailbox -AuthenticationPolicy "Block Legacy Auth"
Verify no legacy authentication methods are enabled:
Get-OwaVirtualDirectory | Select-Object Server, BasicAuthEnabled, WindowsAuthentication, OAuthAuthentication
Get-WebServicesVirtualDirectory | Select-Object Server, BasicAuthEnabled, WindowsAuthentication, OAuthAuthentication
Get-ActiveSyncVirtualDirectory | Select-Object Server, BasicAuthEnabled, WindowsAuthentication
Run a comprehensive connectivity test:
$TestUsers = @("user1@yourdomain.com", "user2@yourdomain.com")
foreach ($User in $TestUsers) {
Write-Host "Testing $User" -ForegroundColor Green
Test-OAuthConnectivity -Service EWS -TargetUri $EwsUrl -Mailbox $User
Test-OAuthConnectivity -Service AutoDiscover -TargetUri $AutodiscoverUrl -Mailbox $User
}
Warning: Monitor your environment closely for 48-72 hours after disabling legacy authentication. Some legacy applications or devices may stop working and require modern authentication configuration or app-specific passwords.
Generate a security report showing authentication methods:
Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, AuthenticationPolicy | Export-Csv "C:\Temp\HMA-Status.csv" -NoTypeInformation
Verification: All virtual directories should show BasicAuthEnabled:False and OAuthAuthentication:True. Azure sign-in logs should show no "Legacy authentication" entries for Exchange access. Test with multiple client types (Outlook desktop, mobile, OWA) to ensure modern authentication works across all scenarios.