Forum Discussion
How to disable IMAP/POP3 globally but excluding a specific mailbox?
- Jan 18, 2019
I called Microsoft today. There is the script to disable IMAP/POP for all mailboxes expect abc@abc.com.
Get-CASMailbox -ResultSize Unlimited | where {$_.Name -ne "abc"} | Set-CASMailbox -PopEnabled $false -ImapEnabled $false
Note: abc is the display name of mailbox abc@abc.com.
Hi Chris,
Thank you very much for your reply. The link is very helpful. The only thing that I need help is how to exclude a specific mailbox? I am not good at PowerShell, if you can add the command of excluding mailbox like abc@abc.com, that will be great!
Your help is appreciated!
If you aren't good at Powershell then rather and try writing a script (unless someone in this forum provides you with one) I would disable the protocols in the Exchange Online admin portal for the selected users or use powershell to disable all users then immediately after enable the protocols on the few mailboxes you need with this article
https://support.microsoft.com/en-in/help/2416434/how-to-enable-or-disable-pop3-imap-mapi-outlook-web-app-or-exchange-ac
Hope that helps
Best, Chris
- Grace YinJan 17, 2019Iron Contributor
Hi Chris,
Your second option can do it, however we will need to disable IMAP/POP for the new created mailboxes manually whenever we creating a new account. We want to automate it. My ideal is to schedule a daily task to disable IMAP/POP for all mailboxes but excepting the specific mailboxes. I just don't know how to add the excluding mailbox command.
Thanks,
- Jan 17, 2019Hi Grace,
The Powershell command here will disable for all future mailbox created
https://gcits.com/knowledge-base/disable-pop-imap-mailboxes-office-365/
1.) Disable all mailboxes
2.) Enable the ones you want
3.) Disable all future mailboxes
Best, Chris- Grace YinJan 17, 2019Iron Contributor
Hi Chris,
Thank you very much! I didn't get it earlier. Yes, this is exact what I want.
Just want to confirm what the future mailbox means. Does it mean the new created mailbox after the first script running? Can I schedule the script to run daily so I don't have to manually run it every time after I create an account? Please advise!
Many thanks!