Link to home
Start Free TrialLog in
Avatar of btny
btnyFlag for United States of America

asked on

Add contacts from a CSV file to a distribution list

Hi,

I have just imported several CSV files into mail enabled contacts in MS Exchange 2010 using this command

Import-Csv C:\Export\EarlyIntervention.csv | ForEach { New-MailContact -Name $_.DisplayName -ExternalEmailAddress $_.EmailAddress -OrganizationalUnit "BoardMembers" }

So now those users are contacts in my AD/MX servers.

I wish to be able to import those members into a distribution list called @BoardMembers howeveer when I run this command

Import-Csv C:\Export\BoardMembers.csv | ForEach-Object -Process { Add-DistributionGroupMember -@BoardMembers -Member $_ }

It doesnt work

Any advice on how to do this is appreciated!
ASKER CERTIFIED SOLUTION
Avatar of KenMcF
KenMcF
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
Avatar of Kent Dyer
Did you see this?

http://tech-informer.com/exchange-2007-powershell-commands-and-tips-115/

Import-Csv | ForEach { New-MailContact -Name $_.Name -Alias $_.Alias -ExternalEmailAddress $_.EmailAddress -OrganizationalUnit Users }

HTH,

Kent
Avatar of btny

ASKER

Ken, YOU ARE MY HERO!!