Exporting DLs AcceptMessagesOnlyFromSendersOrMembers members UPNs

Ranjit Singh 31 Reputation points
2020-07-29T14:54:58.933+00:00

Need help in Exporting EXO DLs AcceptMessagesOnlyFromSendersOrMembers members UPNs

Exchange | Exchange Server | Management
{count} votes

5 answers

Sort by: Most helpful
  1. Vasil Michev 119.7K Reputation points MVP Volunteer Moderator
    2020-07-29T17:13:05.303+00:00

    You cannot export those directly, as the output is returned as Display Names only. You can try "matching" those against the corresponding object, but since Display Name is not an unique attribute, you will end up with ambiguous results.

    0 comments No comments

  2. Ranjit Singh 31 Reputation points
    2020-07-29T17:35:12.397+00:00

    thats a big challenge. Why i need because we are in the process of creating On prem DLs in Cloud. We want to create them exact copy of on prem DLs, any help you can provide here...


  3. KyleXu-MSFT 26,396 Reputation points
    2020-07-30T01:48:05.813+00:00

    You can use command below to get the accept list and convert them to PrimarySmtpAddress:

    (Get-DistributionGroup GroupName).AcceptMessagesOnlyFromSendersOrMembers | Get-Recipient | fl Name,PrimarySmtpAddress  
    

    14365-snipaste-2020-07-30-09-46-30.png

    0 comments No comments

  4. Ranjit Singh 31 Reputation points
    2020-07-30T04:04:22.35+00:00

    Hi Thanks for your response.
    My requirement is as follows:

    1. I have DL Alias names in excel sheet in csv file, so want to pipe this file while fetching below details.
    2. I want to export DL Alias names, and DL AcceptMessagesOnlyFromSendersOrMembers members list with UPNs.

    Ones, i have above details, i can create DLs in Cloud and use this information to update DLs with "Authorised Senders" details.

    Thanks.

    0 comments No comments

  5. KyleXu-MSFT 26,396 Reputation points
    2020-07-30T08:06:40.67+00:00

    Firstly, I need to said, Q&A forum doesn't supported write scripts according to needs so far. We could help modify some script which write by your, but don't supported writing script directly. If you have this kind of demand later, you may need to post it in "stack overflow" forum or open a ticket to Microsoft.

    Here are a script writing by me which may be useful to you:

    $groups = Import-Csv d:/temp/groups.csv  
    foreach ($group in $groups){  
        $name = $group.name  
        $temp = (Get-DistributionGroup $name).AcceptMessagesOnlyFromSendersOrMembers | Get-Recipient | select GroupName,Name,PrimarySmtpAddress  
        foreach ($item in $temp) {  
            $item.GroupName = $name      
        }  
        $temp  
    }  
    

    1.Prepare a csv file as picture below:
    14510-snipaste-2020-07-30-15-57-12.png

    2.Using script below to get detailed information for those group:
    14581-snipaste-2020-07-30-16-00-21.png

    If you want to export the result, you could add ">>location" when running this script:
    14522-snipaste-2020-07-30-16-01-50.png


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.