Powershell Exchange 2010 report to get MAPI disabled accounts

I am trying to get a report piped to a CSV for all USER mailboxes that have MAPI disabled. I have tried the following but the results are not correct.

Get-CASMailbox | select DisplayName, MapiEnabled | Export-csv C:\permissions.csv

Also this pops up.

WARNING: By default, only the first 1000 items are returned. Use the ResultSize parameter to specify the number of
items returned. To return all items, specify "-ResultSize Unlimited". Be aware that, depending on the actual number of
items, returning all items can take a long time and consume a large amount of memory. Also, we don't recommend storing
the results in a variable. Instead, pipe the results to another task or script to perform batch changes.
supportmailAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Will SzymkowskiSenior Solution ArchitectCommented:
Use the following command below...
Get-mailbox -ResultSize "unlimited" | Get-CASMailbox | ? {$_.MAPIEnabled -eq $false} | select DisplayName, PrimarySmtpAddress | Export-csv "c:\DisabledMAPIUsers.csv" -nti

Open in new window


Will.
0
supportmailAuthor Commented:
Running that gets me this.

Sending data to a remote command failed with the following error message: The total data received from the remote clien
t exceeded allowed maximum. Allowed maximum is 524288000. For more information, see the about_Remote_Troubleshooting Help topic.
0
Will SzymkowskiSenior Solution ArchitectCommented:
For this error message specifically you are hitting the max value and it cannot be changed. What you might want to do is run this command 1 mailbox database at a time.

Get-mailbox -ResultSize "unlimited" -Database database1 | Get-CASMailbox | ? {$_.MAPIEnabled -eq $false} | select DisplayName, PrimarySmtpAddress | Export-csv "c:\DisabledMAPIUsers.csv" -nti

Open in new window


Will.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.