Auto generate Password in Privisioning

Hello,

i tried different ways to generate a password or set one specific password in the privisioning of a user but I am not able to get it working.

So sorry if it is a dumb question but how can i achive it to lets say auto generate the password:

i used the following script policy on the user creation OU:

function onGetEffectivePolicy($Request)
#{
if($Request.Class -ne "user"){return}

$Request.SetEffectivePolicyInfo("edsaPassword", $Constants.EDS_EPI_UI_AUTO_GENERATED, $true)

}

When the user gets to the formular (password section), the user needs still to click on the lightning button to generate the password and finish the user creation. In the best case i do not want to show the user who creates the account the password section at all. After creation of the user i will send the password to specific persons/groups who need it via mail.

Please help me out with this and get me to understand the process.

Thanks in advance,

Michael