IMAP and POP3 are disabled on Exchange Server 2013 and 2016 servers by default. Chances are if you need to enable it, you’ll need to enable it on all your servers at once. Fortunately, PowerShell makes this easy!
Run Exchange Management Shell as administrator on an Exchange server and execute the following:
PowerShell Script to enable IMAP on all servers
|$Servers = Get-ExchangeServer | ? IsE15OrLater | Select –exp Name|
|Get-Service –ComputerName $servers –Name “MSExchangeIMAP4”,”MSExchangeIMAP4BE” | Set-Service –StartupType Automatic|
|Get-Service –ComputerName $servers –Name “MSExchangeIMAP4”,”MSExchangeIMAP4BE” | Start-Service|