User-1651604128 posted
In asp.net MVC web app, I was trying to connect the remote Exchange server through powershell , these are the codes:
...
runspace = RunspaceFactory.CreateRunspace(connectionInfo);
try {
runspace.Open(); // the error comes from this line
....
Connecting to remote server ProdServer.ca failed with the following error message :
<f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="3762507597"
Machine="ProdServer.CA"><f:Message><f:ProviderFault provider="PowerShellplugin"
path="%windir%\system32\pwrshplugin.dll"></f:ProviderFault></f:Message></f:WSManFault>
For more information, see the about_Remote_Troubleshooting Help topic.
After googling , it seems it caused there is no enough powershell memory, is this related to my local machine (localhost) who is running this C# codes or it is remote server computer? and how to increase the memory space?
I tried this codes : winrm setwinrm/config/winrs
`@`{MaxMemoryPerShellMB=`"512`"`} , but it is doesnot work.
Is this related to Powershell version? does different powershell has different command to increase the space?
I am using Windows 10 with Visual Studio 2017 Enterprise version.
thanks