delivery management-AcceptMessagesOnlyFrom

Glenn Maxwell 12,876 Reputation points
2022-12-06T14:01:09.22+00:00

Hi All

i am using exchange 2016 hybrid environment. i have some 100 cloud DLs in csv file in the below format. i want to know whether these DLs have restriction and if so which users or group have access to send emails to these DLs i.e delivery management.

dl-list
dl1@Company portal .com
dl2@Company portal .com

Experts guide me with the syntax, i want to try something like the below. i want the syntax for both onprem and online dls.

import-csv "c:\temp\input.csv" | Get-DistributionGroupMember -Resultsize Unlimited |select -ExpandProperty AcceptMessagesOnlyFrom | Select DisplayName,userprincipalname,title,PrimarySMTPAddress | Export-csv -path C:\temp\output.csv -NoTypeInformation  
  
Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,183 questions
Exchange | Exchange Server | Management
0 comments No comments
{count} votes

Accepted answer
  1. KyleXu-MSFT 26,396 Reputation points
    2022-12-07T01:34:00.88+00:00

    @Glenn Maxwell

    May be this one?

    import-csv "c:\temp\input.csv" | Get-DistributionGroup -Resultsize Unlimited | Select DisplayName,AcceptMessagesOnlyFrom | Export-csv -path C:\temp\output.csv -NoTypeInformation  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Glenn Maxwell 12,876 Reputation points
    2022-12-07T05:44:19.64+00:00

    i am getting below error

    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 properties do not match any of the parameters that take pipeline input.

    it should be something like this i belive but i am not getting correct

    $List = import-CSV C:\temp\input.csv
    ForEach ($item in $dl-list){Get-DistributionGroup -Resultsize Unlimited | Select DisplayName,AcceptMessagesOnlyFrom} | Export-csv -path C:\temp\output.csv -NoTypeInformation


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.