How to Disable IMAP access for Users on Exchange 2007 with PowerShell

      Comments Off on How to Disable IMAP access for Users on Exchange 2007 with PowerShell

exchange2007Today i have a strange situation. I need to Block the access to IMAP for all users in my company.

Ok, i have 2 choise :

1. Manual, via Exchange Management Console (oh yehh for some 100 users i droped this)

2. Via Powershell script.

I choided this last, in some second i write a script for this:

[code lang=”powershell”]
get-CASMailbox | Select-Object Identity | foreach {Set-CASMailbox -Identity:$_.Identity -ImapEnabled:$false}
[/code]

For POP3 diabling use:

[code lang=”powershell”]
get-CASMailbox | Select-Object Identity | foreach {Set-CASMailbox -Identity:$_.Identity -PopEnabled:$false}
[/code]

How can you verify? with the next command:

[code lang=”powershell”]
get-CASMailbox | select-Object name, ImapEnabled, PopEnabled
[/code]