Link to home
Start Free TrialLog in
Avatar of jwhitepnv
jwhitepnv

asked on

Exchange Power Shell to add users to a Distribtuion Group

I am looking for a PowerShell script that will allow us to add users in bulk to a Distribution Group. We were able do the DG addistion in bulk but now we need to add the users.
ASKER CERTIFIED SOLUTION
Avatar of crimmel
crimmel
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For some reason, the quote marks in the original code snippet above were dropped and may cause problems for you.  Use the following as I have removed the quotes and run it by typing simply ".\addgroupmemers.ps1".  Be sure to place the csv file in the correct location or point the get-content command to the correct location:

$users = get-content c:\scripts\userlist.csv

Foreach($user in $users)
      {
      Add-qadgroupmember Identity CN=GroupName,OU=OUName,DC=DCName Member $user
      }