Send Command to Add remote users through ARD
The error you're getting is related to the sudo command.  You're probably trying to run the script as the normal administrator.  



Instead, you can run it directly as root.