Link to home
Create AccountLog in
Avatar of Anthony K O365
Anthony K O365Flag for United States of America

asked on

Add bulk users to Distribution Group using Powershell Cmdlet

I need to add about 100 users to a distribution group in my Exchange 2010 organization. The users are in a csv file. What is the power shell command to use to import these users?

Avatar of endital1097
Flag of United States of America image

import-csv c:\users.csv | foreach-object { add-distributiongroupmember <group> -member $ }

where name is the column header
Avatar of Anthony K O365


I'm not sure of the columns in my csv file. Would you happen to know the column fields to provide for my csv?
post the header row and i can tell you what to use
emailaddress  firstname  lastname displayname
import-csv c:\users.csv | foreach-object { add-distributiongroupmember <group> -member $_.emailaddress }


import-csv c:\users.csv | foreach-object { add-distributiongroupmember <group> -member $_.displayname }

Since I'm dealing specifically with Dynamic Distribution Groups, the problem I'm having is the cmdlet is not accepting add-dynamicdistributiongroupMember. Should I not able to substitute this command?
Avatar of endital1097
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
He was absolutely correct. I need to modify the filter

any chance to import users from file to distribution group from csv using column number, because my csv file doesnt have headers?