I have a task to reset training users passwords to a random password and email each person their new password. I have the reset password script working. I just have an issue with the csv file for the email script. The format would be smtpprimaryaddress, newrandompassword in the csv.
How can I get powershell to look at each smtpprimaryaddress and email the corresponding new random password to each user.
I have a one liner that works but I'm not sure how to use variables for the rest.
Send-MailMessage -smtpserver 10.10.10.20 -To firstname.lastname@example.org -From email@example.com -subject "Your training password has been reset" -body "123456"