Why am I unable to change the password on my Mac?

I had a similar problem with my Mac and used the following script to convert my AD-user account to a local one which I have total control over the password.


I looked around into this issue and there must have been an error when the computer was disconnected from the AD (Active Directory) and the domain controller. One thing I read is that reconnecting it back to the AD/server and disconnecting it again will allow you to change your password. That method was discovered from here. Another thing could be an error with the school's domain controller. The systems administrator setting a preferred domain controller can fix this issue as pointed out here.