ExternalInOutlook toggle — recovered example

Inspect the recovered Exchange Online ExternalInOutlook toggle example. It uses the Exchange Online Management module and the recorded Exchange Administrator or activated Global Administrator permissions.

Enabling the Outlook External Email Flag can only be done via Powershell and the Exchange Online Management module. This requires Exchange Admin permissions or PIM to GA.

The setting is currently enabled so the following code is only required if the ExternalInOutlook flag needs to be disabled.

To Disable:

Connect to ExchangeOnline Management

This uses the current logged on user to connect.

Connect-ExchangeOnline -ShowBanner:$false -SkipLoadingCmdletHelp -SkipLoadingFormatData

Then, check the connection status

$connection = Get-ConnectionInformation

if ($connection -and $connection.State -eq "Connected") {

Write-Host "Connection is active." -ForegroundColor Green

}

else {

Write-Host "Connection is not active." -ForegroundColor Red

}

Set-ExternalInOutlook -Enabled $false

Disconnect-ExchangeOnline -Confirm:$false