psexec failing with return code 122 when used from Windows service
Posted
by Jeremy McGee
on Stack Overflow
See other posts from Stack Overflow
or by Jeremy McGee
Published on 2010-03-24T17:10:34Z
Indexed on
2010/03/24
17:13 UTC
Read the original article
Hit count: 821
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.
© Stack Overflow or respective owner