Trying to find a solution to run on a local Windows PC . Win 10, .net 4.0, PS V5.
I need to run multiple .cmd or .ps1 processes in a separate session from the default windows session.
To explain - Typically when you map a network share, the drive is associated with your ‘session’.
I have a requirement to run multiple instances of an application that require the SAME mapped drive letter but each instance requires a different resource name i.e.
Myprog.cmd z: \\server1\myShare
MyProg.cmd z: \\server2\myshare
Under normal circumstances this is not possible.
Possibly I could use powershell with ‘new-pssession’ and the ‘Invoke-command’ using the new session but that will only work if I use psCredentials to get over the double hop issue to access network resources.
There is a restriction here that I have to rely on the currently logged on domain credentials and I cannot prompt the user to re-enter their credentials to create a psCredentials.
So it seems Powershell is out, so I am looking at perhaps a .net C# “wrapper” solution, but I am not all that familiar with any possibilities there. I am sure I can code it if I get some hints as to whatever API/Classes may be suitable. Something like a local terminal session or such, just something that isolates the processes from each other.
Basically the “wrapper” would simply create a new “session” and run the supplied command within that ‘isolated’ session.
I am starting to think though that I may come across the same brick walls as with powershell as I am struggling to find anything suitable.
I understand the restrictions may sound strange and there will be lots of options if I did not have to adhere to them. I would change some if I could but unfortunately I can’t. So just to reiterate they are
- Different instances must be able to run concurrently on the same PC/Laptop.
- Must use same drive letters (different resources for different instances)
- Must use same environment variables (different values for different instances)
- Must use currently logged on user credentials as the default for network resource access
If anybody has some clues or hints as to where else I can go.