locked
Assistance required for a script i am trying to use to add over 600 distribution groups with multiple members to each groups In Exchange 2013 Shell RRS feed

  • Question

  • So i have prepared csv with following content as example-


    Name Displayname Alias PrimarySmtpAddress Members Type
    group1 group1 group1 group1@test.com user1@test.com;user2@test.com Distribution
    group2 group2 group2 group2@test.com user1@test.com;user2@test.com Distribution

    Script being used is -

    Import-CSV C:\Imports\Dist\Distribution1.csv | ForEach {New-DistributionGroup –Name $_.Name -DisplayName $_.DisplayName -Alias $_.Alias -PrimarySmtpAddress $_.PrimarySmtpAddress -Members $_.Members -Type $_.Type}

    TO add the above script works if i was to add multiple groups however only able to add single user per group!

    I tried mod as -

    Import-CSV C:\Imports\Dist\Distribution1.csv | ForEach {New-DistributionGroup –Name $_.Name -DisplayName $_.DisplayName -Alias $_.Alias -PrimarySmtpAddress $_.PrimarySmtpAddress -Members $_.Members -split ";" -Type $_.Type}

    Using the -split ";" parameter however im getting stuck here for best way to implement well i cant so please may someone help me out?

    Thanks in Advance and well after also!

    • Moved by Bill_Stewart Monday, March 12, 2018 9:29 PM Unanswerable drive-by question
    Tuesday, February 6, 2018 10:16 PM

All replies