Re: Import Members into a DL from .csv file



Hi Bharat,

I have tried foreach looping. However, got an error.
Please look into the command what i ran and the error message which i got.

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

[PS] C:\Documents and Settings\akks55>get-distributiongroup -Identity "dl
testin
g 21" | Import-Csv dltestingmembers.csv | foreach
{add-distributiongroupmember d
l testing21 -member "dltesting21$($_.No)"}

----------------------------------------------------------------------------------------------
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 <<<<
dltestingm
embers.csv | foreach {add-distributiongroupmember dl testing21 -member
"dltesti
ng21$($_.No)"}

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

DL Name: Dl testing 21
Alias: dltesting21
File to be imported:dltestingmembers.csv

Would appriciate if you can suggest where i need to change the command with
little explanation...



Thanks fr all your help


"Bharat Suneja [MSFT]" wrote:

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: 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)
  • 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. ... 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)
  • Re: Import Members into DL from a .CSV File in E2k7
    ... rights. ... Please do not send email directly to this alias. ... Initially i ran the below command to get the members of an exsisting DL's ... roperties do not match any of the parameters that take pipeline input. ...
    (microsoft.public.exchange.admin)
  • Import Members into a DL from .csv file
    ... ..csv file. ... 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 ... roperties do not match any of the parameters that take pipeline input. ...
    (microsoft.public.exchange.admin)
  • Process header record and concatenate files
    ... Concatenate the input files into a single output file. ... records reported in the header, ... Specify the list of input files on the command line. ... rewind to beginning of file handle and concat to ...
    (comp.lang.perl.misc)

Loading