Importing .csv into Exchange DL using Powershell

Kelly Denise Horton
Kelly Denise Horton used Ask the Experts™
on
I had this question after viewing Import .csv file into Exchange Distribution Group.
I've got 200 email addresses to put into a newly created DL.  I've tried using the script in the above case (making appropriate changes) and I get the attached error.  The name of the DL is Blackstone Consultants, the .csv file is BlackstoneGroup.csv and is saved on the hard drive in the temp folder.  How can I adjust the script to get it to work?
Error.txt
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Lead email system administrator
Commented:
The term 'Add-DistributionGroupMember' is not recognized as the name of a cmdlet, function, script file, or operable pr
ogram. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

cmdlet Add-DistributionGroupMember from Exchange Server environment. You should run this script from EMC at Exchange Server or from ISE  but at first you need to connect to Exchange server

if (Test-Path $env:ExchangeInstallPath\bin\RemoteExchange.ps1)
    {
         . $env:ExchangeInstallPath\bin\RemoteExchange.ps1
         Connect-ExchangeServer -auto -AllowClobber
    }

https://technet.microsoft.com/en-us/library/dd335083(v=exchg.160).aspx
https://www.codetwo.com/kb/how-to-connect-to-exchange-server-via-powershell/
Kelly Denise HortonConfiguration Management Analyst

Author

Commented:
I was logged onto the exchange server and working in Powershell when I got the error.
Chris DentPowerShell Developer
Top Expert 2010
Commented:
Ensure you run the Exchange management shell. Otherwise you'll have to import the Exchange tools manually and they're not in an auto-discoverable path. Running PowerShell on the Exchange server is not quite enough.
Kelly Denise HortonConfiguration Management Analyst

Author

Commented:
Thanks.  I just ended up  entering the users manually into the DL.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial