# Need help with large environment export

**URL:** <https://forums.powershell.org/t/need-help-with-large-environment-export/13408>\
**Category:** PowerShell Help\
**Created:** [November 12, 2019, 12:08pm UTC](https://forums.powershell.org/t/need-help-with-large-environment-export/13408 "2019-11-12T12:08:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hudzon](https://avatars.discourse-cdn.com/v4/letter/h/a88e4f/32.png) [@hudzon](https://forums.powershell.org/u/hudzon)\
**Post date:** [November 12, 2019, 12:08pm UTC](https://forums.powershell.org/t/need-help-with-large-environment-export/13408/1 "2019-11-12T12:08:01Z")

</div>

Hi guys, need help with get-mailbox cmdlet exports

I have a large exchange 2013 on-prem environment  
110+ servers, over 150k mailboxes  
how can I efficiently run cmdlets to get get mailbox permissions  
all examples point to get-mailbox -resultsize unlimited piped to get-mailboxpermsisions  
as you can imagine, this crashes after running out of memory.

Right now I am using get-mailbox-server | get-mailbox-database foreach mailbox database to get though it without exhausting memory, but it’s taking a very long time with 10K databases

Can anyone offer a more efficient manor to get these results?

---

<div class="post-metadata">

**Author:** ![mikec](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@mikec](https://forums.powershell.org/u/mikec)\
**Post date:** [November 20, 2019, 2:10pm UTC](https://forums.powershell.org/t/need-help-with-large-environment-export/13408/2 "2019-11-20T14:10:01Z")

</div>

I’ve got a module that I’ve used successfully for this - it exports the permissions to csv as it goes. it’s got some rough edges right now and you may have to tweak a bit. Feel free to put in a pull request or issue over on Github. [https://github.com/exactmike/ExchangePermissionsExport](https://github.com/exactmike/ExchangePermissionsExport)

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:31pm UTC](https://forums.powershell.org/t/need-help-with-large-environment-export/13408/3 "2024-05-16T20:31:02Z")

</div>


