How to change the password of a local admin user that has never being logged in using a bash script
I would just make new accounts with the credentials you need and worry about deleting the broken ones later. 


https://www.jamf.com/jamf-nation/discussions/6438/best-way-to-create-hidden-admin-account


If your MDM is JAMF, use their tool to automate hidden admin account creation and push the script out. If not, look for the github / Mac App Store tool CreateUserPkg


https://itunes.apple.com/us/app/createuserpkg/id540673598?mt=12
http://magervalp.github.io/CreateUserPkg/


I wouldn’t reinvent the wheel here and instead, stand on the shoulders of these giants above.