Chat with us, powered by LiveChat

Blog

Back

Count users that are enabled for POP3, MAPI or OWA

16 Sep 2013 by Dan Rose

I was recently asked if it was possible to count how many users in an organisation had POP3 enabled. Fortunately for us, Microsoft have made this task relatively easy with the use of the Get-CasMailbox cmdlet. This simply outputs a list of your users along with a nice formatted table stating whether each of the following protocols/connection type are enabled or not.

  • ActiveSync
  • POP3
  • IMAP
  • MAPI
  • OWA

 Screen Shot 2013-09-10 at 18.57.21

 
Now there are many different ways of totally up each of these fields, but this one is nice a simple and does exactly what is needs to.
 
Get-CasMailbox -ResultSize Unlimited | ForEach-Object {
if ($_.ActiveSyncEnabled) { $ActiveSync++ }
if ($_.OWAEnabled) { $OWA++ }
if ($_.POPEnabled) { $POP++ }
if ($_.ImapEnabled) { $Imap++ }
if ($_.MapiEnabled) { $Mapi++ }
}
$Count = New-Object psobject
$Count | Add-Member -Name ActiveSyncEnabled -Type NoteProperty -value $ActiveSync
$Count | Add-Member -Name OWAEnabled -Type NoteProperty -value $OWA
$Count | Add-Member -Name POPEnabled -Type NoteProperty -value $POP
$Count | Add-Member -Name ImapEnabled -Type NoteProperty -value $Imap
$Count | Add-Member -Name MapiEnabled -Type NoteProperty -value $Mapi
$Count | ft