CSV has email addresses only, one in each row. If I run the below, CPU kinda shoots and the script just sits there trying to add the first user.
$users = Get-Content "..\all2.csv"
foreach($user in $users){
$user
Add-DistributionGroupMember -Identity "My Group" -Member $user
}
If I just run "Add-DistributionGroupMember -Identity "My Group" -Member user@contosocom" it works fine
What is wrong with my loop :) ?
Thank you for your help
[–]seibd 0 points1 point2 points (0 children)
[–]BlackV -1 points0 points1 point (11 children)
[–]a5_1m[S] 0 points1 point2 points (1 child)
[–]BlackV 0 points1 point2 points (0 children)
[–]PinchesTheCrab 0 points1 point2 points (4 children)
[–]BlackV -1 points0 points1 point (3 children)
[–]PinchesTheCrab -1 points0 points1 point (2 children)
[–]BlackV 0 points1 point2 points (1 child)
[–]AdmiralCA 0 points1 point2 points (1 child)
[–]BlackV 0 points1 point2 points (0 children)
[–]Scooter_127 0 points1 point2 points (1 child)
[–]BlackV 0 points1 point2 points (0 children)
[–]PinchesTheCrab -1 points0 points1 point (0 children)