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?
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.