Good afternoon,
I have the following doubt, I am creating a script to create a user in my Active Directory automatically with PowerShell ISE.
In the following script I want these two users to have the same password without having to type it twice, that is, when I am asked to enter the password for each user.
I want that at the moment of placing the password, I take it for these two users that I am creating as an example.
Someone who can guide me please.
Best regards.
$user = New-ADUser "Roberto"
$pwd = Read-Host "Ingresar Contraseña" -AsSecureString
$pwd = Set-ADAccountPassword Roberto -NewPassword $pwd
Enable-ADAccount Roberto
$user = New-ADUser "Rocio"
$pwd = Read-Host "Ingresar Contraseña" -AsSecureString
$pwd = Set-ADAccountPassword Rocio -NewPassword $pwd
Enable-ADAccount Rocio
Open in new window