Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

memory quota Issues when running script

$
0
0

Get-Mailbox -ResultSize Unlimited | Get-MailboxFolderStatistics | Where-Object {$_.Name -eq "Outbox" -and $_.ItemsInFolder -gt '0' } | Select-Object Identity, FolderType, ItemsinFolder, FolderSize | Export-CSV "C:\Outbox.csv"

Hi Guys

When I run this script it is able to get some data in the csv file but eventually I get a message bellow.

Processing data for a remote command failed with the following error message: Deserialized objects exceed the memory quota. For more information, see
 the about_Remote_Troubleshooting Help topic

I tried setting the MaxMemoryPerShellMB from the default to 1024 and then 2048 but I still have the problem. Is there a way I can get that to work? Would a ForEach-Object be better and not have the memory issuesbecause it would not have to load all into memory. Our Exchange Org is very large.

Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1024

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles