Avatar of Anthony K O365
Anthony K O365
Flag 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?

Thanks!!
Exchange

Avatar of undefined
Last Comment
sarelis

8/22/2022 - Mon
endital1097

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

where name is the column header
Anthony K O365

ASKER
I'm not sure of the columns in my csv file. Would you happen to know the column fields to provide for my csv?
endital1097

post the header row and i can tell you what to use
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Anthony K O365

ASKER
emailaddress  firstname  lastname displayname
endital1097

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

or

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

Anthony K O365

ASKER
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?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
endital1097

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Anthony K O365

ASKER
He was absolutely correct. I need to modify the filter

thanks
sarelis

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