Skip to content

Instantly share code, notes, and snippets.

@TheRealNoob
Created March 30, 2017 04:11
Show Gist options
  • Save TheRealNoob/73983633954c455ceaa2f43677160f56 to your computer and use it in GitHub Desktop.
Save TheRealNoob/73983633954c455ceaa2f43677160f56 to your computer and use it in GitHub Desktop.
$list = import-csv file.csv
Foreach ($person in $list) {
Send-MailMessage -To $person."E-Mail Address" -Subject "Password expires in $person."Password expires in" days" `
-From * `
-Body "$person."Display Name", your password is due to expire in $person."Password expires in" days. Please change it or die."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment