Script set change security profile.

Have a look at this link http://forum.mikrotik.com/t/random-wifi-password/82665/11