I've written a WCF service as a wrapper around a C# utility we've written that uses the SysInternals psexec
utility to run jobs on a remote system. psexec
is invoked from C# with command-line parameters that specify the domain, user and password to use.
All works fine when I invoke the C# utility from PowerShell locally.
However, when I run the utility from the WCF service we see a return code of 122, which corresponds to (?) "The data area passed to a system call is too small".
psexec
is running against Windows Server 2008. The credentials I'm passing are local administrator, in the same domain as the machine that hosts the service wrapping the utility.