[Exchange-Online][EWS][C#][Windows version] GetSearchableMailboxes and Get_Mailbox different mailboxes RRS feed

  • Question

  • When we call GetSearchableMailboxes with no filters we get tens of thousands of results. Examination shows some known mailboxes are missing. Calling it with one of the missing one's name a filter correctly returns that mailbox. 

    Using powershell Get-Mailbox  -ResultSize Unlimited with the same credentials returns more mailboxes than EWS and includes the 'missing' ones.

    Any insight into what's going on here? Is it actually possible to get all mailboxes with GetSearchableMailboxes ?

    Wednesday, February 27, 2019 1:54 PM

All replies

  • Hi,

    When you query without any filter/parameters, Get-Mailbox cmdlet will return top 1000 mailboxes list. The ResultSize parameter specifies the maximum number of results to return.

    Regards From: Exchange Online | World of Cloud Computing

    Wednesday, February 27, 2019 2:13 PM
  • There's no problem with the cmdlet, using the  -ResultSize Unlimited parameter we get everything (10's of thousands of results). The problem is with the unfiltered EWS GetSearchableMailboxes  api, it too returns 10's of thousands, but thousands less than the cmdlet.  
    Wednesday, February 27, 2019 2:25 PM
  • Hi,

    Thanks for more clarity. I guess the Global Throttling Policy of your Exchange environment is restricting the results count. 

    [PS] C:\Windows\system32>Get-ThrottlingPolicy |fl *ews*

    EwsCostThreshold                      : 50
    EwsMaxConcurrency                     : 27
    EwsMaxBurst                           : 300000
    EwsRechargeRate                       : 1800000
    EwsCutoffBalance                      : 0
    EwsMaxSubscriptions                   : 5000
    DiscoveryMaxPreviewSearchMailboxes    : 5000
    DiscoveryPreviewSearchResultsPageSize : 200

    As this is a global policy, you should need to create a new ThrottlingPolicy and adjust the above EWS parameters.

    Following is an example cmdlet. This creates a new policy named newewspolicy with DiscoveryMaxPreviewSearchMailboxes set as 10000

    New-ThrottlingPolicy newewspolicy -DiscoveryMaxPreviewSearchMailboxes 10000

    Make sure to apply the policy to the user who is doing the 'Discovery Search'

    For example,

    Set-Mailbox manu -ThrottlignPolicy newewspolicy

    Try again after modifying the affected parameters

    Regards From: Exchange Online | World of Cloud Computing

    Wednesday, February 27, 2019 4:20 PM
  • Unfortunately Get-ThrottlingPolicy cmdlet is available only in on-premises Exchange. This is online.  
    Thursday, February 28, 2019 9:26 AM