forms - New-ADuser echo user password -
attempting set powershell form creates new user in our ad, script works great being contractors need echo password input , save csv exporting. below have far
new-aduser -name "$d" -accountexpirationdate "$j" -accountpassword (read-host assecurestring "enter password below")
secure strings aren't secure 1 might think. read password variable instead of putting read-host
in subexpression:
$pw = read-host -assecurestring -prompt "password" new-aduser -name "$d" -accountexpirationdate "$j" -accountpassword $pw
and can decrypt secure string this:
$cred = new-object management.automation.pscredential ('x', $pw) $cred.getnetworkcredential().password
Comments
Post a Comment