Saturday, 19 July 2014

SharePoint Remoting Out of Memory Exception

Remoting Out of Memory Exception
i ran below command
Get-SPTimerJob in a server, list is successfully executed.
But while running in remotely i am getting Out of Memory Exception.
Root Cuase: remoting client memory
Solution: Need to increase MaxMemoryPerShellMB
Default value is 150 ...seems it's not enough
I increased to 512
set-item wsman:localhost\Shell\MaxMemoryPerShellMB 1024
It solved my problem
So i have executed my command remotely..
---------------------------------------------------------------
$Server="SERVER NAME"
$ps = New-PSSession -ComputerName virtual1
Invoke-Command -Session $ps -ArgumentList $Server

{
Add-PSSnapin Microsoft.SharePoint.PowerShell
Get-SPTimerJob
}
Remove-PSSession $ps