ewilhelm_paessler
Hi there, In case this helps you I've been able to make our inhouse Exchange admin tool work with remote powershell.
I did nothing to change the setup of the runspace but changed the way powershell commands are executed and it appears to be working.
Using AddCommand() instead of AddScript()
Example code that is not working:
Powershell ps = GetPowerShellInstance();
ps.AddScript("Get-Mailbox -identity 'testuser@contoso.com'");
Collection<PSObject> collection = ps.Invoke();
Example code that is working:
Powershell ps = GetPowerShellInstance();
ps.AddCommand("Get-Mailbox");
ps.AddParameter("Identity","testuser@contoso.com");
Collection<PSObject> collection = ps.Invoke();
I hope this is helpful for others.