Assume I have a distribution group in Exchange which currently exists, and holds about 20 members.
In Powershell 2, I have acquired a list of about seven hundred more individuals who need to be added to the group. The only way I have been able to do this is one user at a time:
Add-DistributionGroupMember -Idneity GROUP-NAME -Member Member1 Add-DistributionGroupMember -Idneity GROUP-NAME -Member Member2 .... Add-DistributionGroupMember -Idneity GROUP-NAME -Member MemberN
Is there a mechanism available that allows me to add all users with just one function call, as represented by the following pseudo-code?
SOME-CMDLET-TO-ADD-LOTS-AT-ONCE -Identity GROUP-NAME -Member COLLECTION-OF-PEOPLE
I'm not looking for loop constructs. I'm looking for a function or cmdlet that can add all members at once, ideally taking only one argument referencing the entire list. I'm scared to think what Powershell would do with 700+ command-line arguments...
(I'm hoping that if this IS possible, that I can pass an array or collection of objects to be added.)
Any suggestions? I don't see a command called 'set-distributiongroupmember', and I also don't see anything promising in 'set-distributiongroup'.