Find The Total Number Of Mailboxes In Your Organization…

How can you quickly find the total number of mailboxes in your organization? You can do it now by running a shell command. Get-Mailbox | Measure-Object You can further customize the command to your  requirements. Let’s say that you want to find out the mailboxes in one particular database or one particular server. You can…

How can you quickly find the total number of mailboxes in your organization? You can do it now by running a shell command.

Get-Mailbox | Measure-Object

You can further customize the command to your  requirements. Let’s say that you want to find out the mailboxes in one particular database or one particular server. You can find it by adding more switches to the above command. Run the following…

Get-Mailbox –database dbname | Measure-Object

Get-Mailbox –Server servername | Measure-Object

10 Comments

  1. Finds all Disabled Mailboxes where user has not logged in over 60 Days

    $DisabledMailbox = (Get-MailboxStatistics -Database $database) | Where-Object {$_.DisconnectReason -eq “Disabled” -and $_.DisconnectDate -lt (Get-Date).AddDays(-60)}

    $count = $DisabledMailbox.count

  2. This is all very usefull. but what if you want to exclude? i am asked to prived the number of users in our organization, but not the service-, admin-, functional-, and out of service-accounts. Is there a commandline which can help me

    1. Rajith Enchiparambil says:

      Hi Robin,

      If these type of users are in different OUs, you can filter with the OU parameter and pipe it to measure-object.

      Get-Mailbox -Resultsize Unlimited -OrganizationalUnit “domain.local/Accounts/Users” | Measure-Object.

      1. annoymouys says:

        Hi,

        How about t count the mailbox of discoonected in the db or the server ?

        1. Finds all Disabled Mailboxes where user has not logged in over 60 Days

          $DisabledMailbox = (Get-MailboxStatistics -Database $database) |
          Where-Object {$_.DisconnectReason -eq “Disabled” -and $_.DisconnectDate -lt (Get-Date).AddDays(-60)}

          $count = $DisabledMailbox.count

  3. Anonymous says:

    what if you only want your 2010 mailboxes? this will return all mailboxes both 2003 (if you have them and 2007 and 2010…

  4. Rajith Jose Enchiparambil says:

    Thanks Anonymous.

  5. Anonymous says:

    i would do this:

    (get-mailbox -resultsize unlimited *domain.com).count

    You cna omit the *domain.com to get all mailboxes.

  6. Rajith Jose Enchiparambil says:

    You are right Tommy.

    If you have a bigger organization, resultsize has to be added so that it picks all the mailboxes.

    Thanks.

  7. Tommy Becker says:

    correction:

    get-mailbox -ResultSize unlimited | Measure-Object

Leave a Reply

Your email address will not be published. Required fields are marked *