I am trying to push a small script to a test mac.  The script will make the current logged in user an admin of the Mac.  The script works when I pass the username over to the Mac.  But as soon as I try to use a variable to get the logged in current user, the script fails.


This works (the current username is user2)

dseditgroup -o edit -a user2 -u localadmin -P mm1007mm -t user admin


This fails with the following (using $USER to get the current logged in user)

dseditgroup -o edit -a $USER -u localadmin -P mm1007mm -t user admin


2014-04-22 10:03:46: Alert not enabled, moving to next phase....

2014-04-22 10:03:52: Sending script script.sh to client....

2014-04-22 10:03:57: Script sent

2014-04-22 10:03:57: Executing script....

2014-04-22 10:04:01: Error 64 received while executing script


Any help would be greatly appreciated.

0 Comments   [ - ] Hide Comments


Please log in to comment

There are no answers at this time
Answer this question or Comment on this question for clarity


Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja