Last post Jul 08, 2014 03:05 AM by Starain chen - MSFT
Jul 07, 2014 11:49 AM|vincent pare|LINK
I am facing a problem that cause me headaches (literally), I hope if you can help me with it :
Given that my Powershell is on an other server than my application, in c#, you can create a "Powershell remote session" by defining an WSManConnectionInfo and using this during the "runspace" creation.
Somthing like :
var runspace = RunspaceFactory.CreateRunspace(WSManConnectionInfo);
But the problem is :
When we are working with the remote session, we can only use some commands(Not all the commands are available). So, you can't use the "Import-Module" command directly in the remote session.
So I am asking you if you can help me to find a solution in c# (or just some hint) to use imported module in the remote session.
I know there's a lot of solution out there (Pure Powershell command), but I am just not good enough to convert these solutions in c#.
Jul 07, 2014 11:51 AM|smirnov|LINK
Is that connected somehow to asp.net and active directory (see name of the forum)?
Jul 07, 2014 11:53 AM|vincent pare|LINK
Yes, my application is in ASP.NET.
And yes, because I am trying to modify AD user.
Jul 08, 2014 03:05 AM|Starain chen - MSFT|LINK
Please refer to this thread:
# Error while running AD commandlets in powershell from C#