Re: Import Members into a DL from .csv file



You need to import-csv first, iterate through each row in the csv using a foreach loop, and invoke add-distributiongroupmember within the foreach.

--
Bharat Suneja
Microsoft Corporation
blog: exchangepedia.com/blog

This posting is provided "AS IS" with no warranties, and confers no
rights. Please do not send email directly to this alias. This alias is for
newsgroup purposes only.
----------------------------




"Shivaram" <Shivaram@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:02D88BF2-E728-4F3E-8092-7719E718DE3D@xxxxxxxxxxxxxxxx
Hi All,

I have tried few commands to import members into a distribution group from a
.csv file.

Initially i ran

Get-DistributionGroupMember - Identity "DL NAME" | Export-Csv
"C:\DLMEMBERS.CSV"

-------------------------------------------------------------------------

Now i have the output file in .csv format in my "C" Drive

Finally this is the command i am running the below command to import this
output file into another DL

Get-distributiongroup "DL NAME" | Import-Csv "C:\DLMEMBERS.CSV"

Error:

Import-Csv : The input object cannot be bound to any parameters for the
command
either because the command does not take pipeline input or the input and
its p
roperties do not match any of the parameters that take pipeline input.
At line:1 char:61
+ Get-DistributionGroup -Identity "dl testing 21" | Import-Csv <<<<
"c:\dltest
ing21.csv"

I tried few more cmdlets like set-group which did not work out.

Please suggest me ....

Thanks in advance



.



Relevant Pages

  • Re: Remove all Security.
    ... Hi Douglas, ... The command seems to be ... This macro is a name "Test PPS CSV format". ...
    (microsoft.public.access.security)
  • Re: Export multiple sheets to 1 csv file.
    ... I'd save all the .csv files into a dedicated folder to keep them ... Then I would shell to a command prompt and issue an old DOS command. ... Sub testme() ... Dim myTempFolder As String ...
    (microsoft.public.excel.programming)
  • Re: Word from command prompt?
    ... Word doesn't have an export filter to CSV the way Excel does. ... I want a comma between each table cell in the CSV file. ... run a macro or a built-in command that doesn't need any further information ...
    (microsoft.public.word.docmanagement)
  • Re: Searching for a solution with Batch programming
    ... file from a FTP and convert it to CSV, getting the file was a 2 second ... then just use a .Net Console ... response for Excel, Excel costs money, and with a very tightly run ... command or exit dialog command I could throw up, ...
    (comp.programming)
  • Re: Import Members into a DL from .csv file
    ... Please do not send email directly to this alias. ... foreach loop, and invoke add-distributiongroupmember within the foreach. ... Finally this is the command i am running the below command to import this ... roperties do not match any of the parameters that take pipeline input. ...
    (microsoft.public.exchange.admin)