Re: Import Members into a DL from .csv file



Get-DistributionGroupMember MyGroup1 | foreach {Add-DistributionGroupMember MyGroup2 -member $_.identity}

--
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.
----------------------------




"Bharat Suneja [MSFT]" <bsuneja@xxxxxxxxxxxxxxxxxxxx> wrote in message news:%23gGY9HcHJHA.2580@xxxxxxxxxxxxxxxxxxxxxxx
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
    ... I have tried foreach looping. ... Please look into the command what i ran and the error message which i got. ... roperties do not match any of the parameters that take pipeline input. ... Now i have the output file in .csv format in my "C" Drive ...
    (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)
  • Re: OT: the rm bug hit me again
    ... And the -f in the rm command it to stop the "Confirm delete?" ... My rm is set to confirm all deletes using alias. ... the reason is to help prevent those type human errors when you are root ... I personally like the prompt because it reminds me that I am running as ...
    (Fedora)
  • Re: Def alias error in RACF
    ... to define an Alias in a RACF environment with z/OS V1.7 release? ... At the moment to send the request in command line (through the RACF ... Actually, that's a TSO command, not a RACF command. ...
    (bit.listserv.ibm-main)
  • Re: OT: the rm bug hit me again
    ... And the -f in the rm command it to stop the "Confirm delete?" ... That's not a good idea as it teaches you to expect to be prompted, and you'll be bitten badly some time when the alias isn't present. ... the reason is to help prevent those type human errors when you are root ... A user who expects rm to prompt will only delete their own files if it doesn't, a root user who expects rm to prompt can delete the entire system if it doesn't. ...
    (Fedora)