Wednesday, May 21, 2008

EMS Goodies: Populating a Distribution Group from a File

Given a text file containing a list of samAccountName items, here is the command to stuff those accounts into a Distribution Group. It is assumed that the group has already been created and that the file is in the current directory.



cat ".\users_to_add_to_group.txt" | get-mailbox | Add-DistributionGroup Member -id "MyGroup"

No comments: