locked
How can I send email to a list of users via Powershell RRS feed

  • Question

  • How can I send email to a list of users via Powershell---

    I generated a list of users in powershell that are in a specific set of security groups and I would like to send email to them all from the same script.  Is this possible in Powershell.

    Thanks.


    POWERSHELL

    Tuesday, May 21, 2019 4:09 PM

All replies

  • Tuesday, May 21, 2019 4:16 PM
  • Mail-enabled security groups are usually a poor choice. Mail-enabled Distribution groups are a better choice and, if you're using MS Exchange, make sure the groups have a Universal scope.

    However, you've omitted whether the group(s) are mail-enabled or not. If they are, it's probably as easy as sending the e-mail to the groups and not to the members of the group.

    If your e-mail system doesn't understand how to send mail to a group you'll have to extract the groups' membership and then get the e-mail address of those members from the individual AD objects -- and don't forget that security groups are likely to include members that have no e-mail addresses (e.g. other security groups, administrative accounts, etc.).

    So, yes, it's possible, but the ease of doing so will vary depending on a number of variables you haven't stated.


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    Tuesday, May 21, 2019 6:30 PM