Hi, this simple script has saved me a lot of time for setting passwords for AD users from my TXT file, However, I would like to know, what I can change/alter the below Powershell script<\/em> to have it write to a .txt or .csv file on my local drive,<\/strong> rather than display the passwords in the dialog box ?? TY<\/p>\n
# Load user list\n$ListOfUsers = Get-Content C:\\temp\\list.txt\nforeach ($user in $ListOfUsers) {\n #Generate a 12-character random password\n $Password = -join ((33..126) | Get-Random -Count 8 | ForEach-Object { [char]$_ })\n #Convert the password to secure string\n $Pass = ConvertTo-SecureString $Password -AsPlainText -Force\n #Reset the account password\n Set-ADAccountPassword $user -NewPassword $Pass -Reset\n #Force user to change password at next logon\n Set-ADUser -Identity $user -ChangePasswordAtLogon $true\n #Display userid and password values\n Write-Host $user, $Password\n}\n<\/code><\/pre>\n