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 email@example.com -From firstname.lastname@example.org -subject "Your training password has been reset" -body "123456"