add a new email domain to 40+ distribution list as alias RRS feed

  • Question

  • I'm just wondering if I can ask for some assist? 

    We are using O365 Exchange and it's synced with our AD. 

    Basically we have purchased a new domain and I'm trying to add the new domain to about 40+ of our distribution list under the proxyaddresses as smtp:email. 

    We have the groups setup as follows. 

    Group Name: Test 1

    Email: test1@test.com

    I have tried with the below though it only puts the domain in not with the part before the @test.com 

    $Distros = import-csv C:\Output\test.csv

    foreach ($d in $distros)
        $DistroName = $d.name
        $group = get-adgroup $distroname -properties proxyaddresses

        set-adgroup $group -add @{proxyaddresses="smtp:" + "test.com"}

    Monday, February 11, 2019 7:42 AM

All replies

  • Please look in the Gallery for scripts that do this.  Almost every new user of O365 and AD/Exchange asks this same question.  The script has been written times.


    Monday, February 11, 2019 9:36 AM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,


    Just do it.

    Thursday, February 28, 2019 2:38 PM