I have written a small application to run a password change via the net user command using the php system function. I already understand how privileges in this situation work. Since its running on an internal intranet and only for a few days I have setup IIS 5 to run as administrator and the administrator has full system access with no restrictions. The script works on 2 of the 3 servers, and returns a result after execution. The third server returns the value "2" after running the same script. I am able to return a response for a simple command like "net user", so I know the script is executing correctly. But when attempting to run the password change command or any other advanced command the value "2" is returned in all situations. When running that same command from the command line I either get a successful completion message or at least a net user error. The only conclusion I could come to was a permission error, but running IIS as admin has thrown me for a loop. Any help is appreciated, thanks in advance.
- 2 of the 3 servers are domain controllers
Without confusing everyone with a lot of code, here is a simplified version of my script.
<?PHP
// this should return a net user error or help message
system("net user testacct testpass", $res);
echo $res;
?>
- This problem has been resolved. To be honest I have no idea why it works. I rebuilt the IIS web 5 times, with the exact same settings very time, on the 5th time it just worked. Thats MS for you. Wish they would let me use Apache here 😛