Get list of mailboxes in my organization RRS feed

  • Question

  • ($O365 = Get-Mailbox -ResultSize Unlimited | Where {$_.RecipientTypeDetails -eq 'UserMailBox'} | Select -Property Name , Alias). Count
    Where Customer has 180000+ mailboxes in his org, 
    Command gives error : processing of data from the remote server failed with the following error message: Access denied" : For more info For more information, see the about_Remote_Troubleshooting Help topic

    at the end of the error it displays the count of 28526 mailboxes only, where the Customer has 1,80,000+ mailboxes

    Your help will be highly appreciated 
    • Moved by Bill_Stewart Thursday, December 20, 2018 9:20 PM This is not "scripts on demand"
    Thursday, October 18, 2018 5:45 AM

All replies

  • "Access denied" means that you cannot count those mailboxes.  The issue has nothing to do with your script it is because you lack correct permissions to access them.

    If you think this is wrong then I suggest placing a call to MS support.


    Thursday, October 18, 2018 6:05 AM
  • Today when ran the same COmmand , it give me the same error with Count 45000+ Mailboxes.
    its a Global Admin.
    • Edited by Jacob Khan Thursday, October 18, 2018 6:41 AM
    Thursday, October 18, 2018 6:37 AM
  • I'd suggest not to let PowerShell handle the filtering if it's already build in with the command.

    With just a few objects it doesn't matter much. But it's not wise when talking 180.000+ objects, because each of those objects will go through the pipeline.

    Try this instead:

    $O365 = Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox

    If you still get Access denied I guess its because you have insufficient permissions

    Thursday, October 18, 2018 8:41 AM
  • i understand, let me perform it and update you accordingly.
    • Edited by Jacob Khan Thursday, October 18, 2018 10:17 AM
    Thursday, October 18, 2018 10:17 AM
  • Tried above suggested but still the Customer is getting the same error Message. Can anyone help me on this.
    Friday, October 19, 2018 10:42 AM
  • Give the customer rights.

    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
    Celebrating 20 years of providing Exchange peer support!

    Saturday, October 20, 2018 1:28 AM