Public/Disconnect-Exchange.ps1

1
2
3
4
5
6
7
8
9
function Disconnect-Exchange {
    <#
.SYNOPSIS
Disconnects the previously opened remote Exchange session, if Connect-RwExchange was used. Must use an account from that tenant; cannot be a delegated admin.
#>

    Remove-PSSession -Name $ExchangeSessionNamePreference

}