I think I got it!
I had to specify the domain\username like this:
$cmd = 'schtasks.exe /query /s <server name> /u <domain>\
<username> /p <password> /tn "repost_labor" > test.txt >2>&1';
echo exec($cmd, $out, $retval);
When I put that in it worked!
Thanks so much for your help, Fou-Lu, especially with the idea and code to output the STDERR.