Kedar,
I am using GlassFish v2ur1-b09d-linux-ml on a CentOS 5 system. I just tested the command and it works just as I explained.
-bash-3.1$ asadmin change-admin-password --user admin --port 4848
Please enter the old admin password>adminadmin2
Please enter the new admin password>adminadmin
Please enter the new admin password again>adminadmin
Updated .asadminpass file with new password.
Command change-admin-password executed successfully.
As for why am asking if its possible that the password change in the admin console updates this file it is because when you change the password in the admin console you are also changing the password for the asadmin tool. Since this file is not updated when the change in the admin console takes place my script fails.
Do you have a .asadminpass file in the home directory of the user you are executing the command as? Also when you created the domain you may have not set the flag for asadmin to save the password. Like for example "asadmin create-domain --user admin2 --adminport port_number --savelogin=true domain2".
It will be nice if the password is updated in that file or if the authentication for the admin console was separate from that asadmin tool.
If it is not possible then will have to find another way around it. Just though I would ask.
Thank you
[Message sent by forum member 'nayabinghi' (nayabinghi)]
http://forums.java.net/jive/thread.jspa?messageID=294256