Changing a password using any terminal method when it starts with )

Good morning,


We are in the process of changing the admin password on all of our computers here, and it begins with a ). In every script I have tried to use I get the same error message, "syntax error near unexpected token `)', would anyone have an idea as how not to read the ) as part of the syntax but rather a character in the password?


Thank you in advance

iMac Line (2012 and Later)

Posted on Oct 9, 2019 3:57 AM

Reply
3 replies

Oct 12, 2019 10:28 AM in response to Luis Sequeira1

There are a number of things that can go wrong when implementing this via ARD. Sadly a student got our password and it has spread quite quickly across several schools. I did however get my answer which was to use quotation marks when implementing it will mitigate the syntax error. As there are over 1100 iMacs in my district I understand the oddity of the question, but I needed a fast and efficient way to change the password before I had them installing more corrupt programs which have already wiped out 126 computers and their information. Thank you very much for you response.

Oct 12, 2019 3:03 AM in response to wjr02149

You have quote special characters that might otherwise be interpreted by the shell.

I have to say that your asking this saying you are about to script something so sensitive as changing admin passwords is cause for concern.


Bear in mind that an error in this process may result in users not getting access.



At the very least don’t do this without a solid bootable backup in place.


And make sure you understand what is going on.


There is so much that can go wrong.

Oct 11, 2019 1:41 PM in response to wjr02149

Hello wjr02149,


Welcome to the Apple Support Communities. I understand there are some syntax errors using a script with your Mac. I'll help in any way I can.


If you're using AppleScript, it's possible to use '\' as an escape character before the parentheses. Try using this or you might have to use another character within terminal. This developer article might help if you're using strings in your script: Formatting Strings


Cheers.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Changing a password using any terminal method when it starts with )

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.