Getting to the bottom of this...

I used the script in my first post to search for a task event with my userID - one I had just created to test this. I then ran the script - the only modifications were to search for my userID, and to query my test server. Here's the results:
 Code:
TECHSERV14 - C:\temp>jt.exe /SM \issp01 /SAC "test" /SC "NewUser" "pass
word123"
[TRACE] Setting target computer to '\\issp01'
[TRACE] Activating job 'test'
[TRACE] Setting account information
[FAIL ] IPersistFile::Save hr=0x80041310

TECHSERV14 - C:\temp>echo %ERRORLEVEL%
0

Clearly, JT is issuing an error MESSAGE, but is not setting its EXIT CODE. The hex message does translate to "Unable to establish existence of the account specified", so this does make sense.

It will take some significant (ie - more than 30 minutes) effort to rewrite the calls to JT to properly parse the messages. I'll probably have time to do this over the holiday week coming up. If you need a quick fix, you can edit the USER DEFINED lines in the tcInit() function - specifically -
$tcOUTPUT = ' >"NUL:"'
Change "NUL:" to a path, or even a pipeline. Something like
$tcOUTPUT = ' |find "[FAIL ]" >"C:\temp\tcOUT.txt"'
With this example, the tcOUT.txt file will be empty on success, and contain the error message on failure.

I'll have to rethink some of the error handling methods in the library, as there are some custom messages that need to be taken into account.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D