Quantcast
Channel: Software Communities : Popular Discussions - ActiveRoles
Viewing all articles
Browse latest Browse all 1277

Set user password via powershell script

$
0
0

Hello,

 

i'm using a custom script to generate and assign a random password to users.

 

Let's say we have user pippo with password 'test', i execute the following script (via ARS workflow):

 

function onInit($context) {

    $context.UseLibraryScript("Library - password generation")

    }

 

function onPreModify($Request) {

     $newpass = RandomPassword -length 5 -pattern "NNNNN" # custom function for password generation

 

     $Request.put("edsvaTempPwd",$newpass) # i have to use a virtual attribute to temporarily store the password in clear-text since i need to notify via mail the new password to the user's boss

     $Request.put("edsaPassword",$newpass )

     $Request.put("edsaPasswordNeverExpires",$false)

     $Request.put("edsvaUserMustChangePasswordAtNextLogon",$true)

     }

     

But the password is not changed, pippo can still access to workstations with old password 'test'. Am i missing something?

 

Thanks,

Andrea


Viewing all articles
Browse latest Browse all 1277

Trending Articles