Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-EXOMailbox performance #28

Open
vradchenko opened this issue Jan 20, 2021 · 1 comment
Open

Get-EXOMailbox performance #28

vradchenko opened this issue Jan 20, 2021 · 1 comment

Comments

@vradchenko
Copy link

vradchenko commented Jan 20, 2021

Hi CrowdStrike,

Cool script, but poor performance with big Office365 environments. Say, the following commands are specified: SMTPForward, FullAccessGranted, AnyAccessGranted, SendAsGranted together. This means script will run
Get-EXOMailbox -ResultSize Unlimited -ErrorAction SilentlyContinue | Get-EXORecipientPermission -ErrorAction Stop 4 times. This works well with small number of mailboxes, but a single execution of this command on, say, 50000 mailboxes will take a few days (believe me) to complete (eventually Microsoft will throttle you and slow down the requests). Your script calls it 4 times which will easily take more than a week (not counting possible auth session expiration when you'll need to restart the script).

My proposal would be first to save mailboxes to a variable like $mailboxes = Get-EXOMailbox -ResultSize Unlimited -ErrorAction SilentlyContinue and same for $permissions = $mailboxes | Get-EXORecipientPermission -ErrorAction Stop and reuse both $mailboxes and $permissions where possible. Let me know if I can contribute to the project!

@csdr4
Copy link
Collaborator

csdr4 commented Jan 27, 2021

Hi @vradchenko, thank you for your input. That sounds like a great idea, to be honest. You're welcome to contribute to the tool and I can review any modifications prior to publishing. Any other feedback for improving performance is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants