This CodeLet allows to set the user password during Rule execution, the following process can be used.
- create user entity ($newuser)
- set a rules variable $password (use PHP code to generate a random string)
- execute custom PHP which looks like
This way, you can also use the variable $password in say, an email to the user letting them know what their automatically generated password is.
CodeLet
<?php$edit = array('pass' => $password,);user_save($newuser, $edit);?>