none
Get customized distribution list report in Exchange By Power-Shell RRS feed

  • Question

  • Hi there!

    I am trying to obtain report for distribution lists in particular OU, and the result show showing the below Columns:

    ( DL name, OU, AcceptMessagesOnlyFromSendersOrMembers, ManagedBy, Count )

    NOTE: need to get the (AcceptMessagesOnlyFromSendersOrMembers) result by the user displayname not canonical name

    Thank you in advance 

    Sunday, January 27, 2019 6:56 AM

All replies

  • Hello , 

    Credit should go to the person who has wrote this given blog .Please check the following link you will get some idea about using replace in the Powershell command to get the output in the format as you wish .

    https://mikefrobbins.com/2014/07/10/extract-the-name-from-an-active-directory-distinguished-name-with-powershell-and-a-regular-expression/

    Example : Select-Object -Property name, OU, ManagedBy, @{label='AcceptMessagesOnlyFromSendersOrMembers';expression={$_.AcceptMessagesOnlyFromSendersOrMembers -replace '^CN=|,.*$'}}


    Thanks & Regards S.Nithyanandham

    Sunday, January 27, 2019 3:28 PM
  • Hi Nithyanandham

    Thanks for your great support, let me show you what I have tried to use :

    Get-DistributionGroup -OrganizationalUnit "OU Name which contains the Distribution Group  " -ResultSize Unlimited  | select CustomAttribute9,  name, DisplayName,OrganizationalUnit , AcceptMessagesOnlyFromSendersOrMembers, ManagedBy | Export-Csv C:\Temp\filename.csv
    

    So how to insert the example you mentioned in the above query?

    NOTE: I need help to for expression for this 2 attributes "ManagedBy" & "AcceptMessagesOnlyFromSendersOrMembers"

    Really Appreciate your help and support in advance

    Monday, January 28, 2019 6:14 AM
  • Hello , 

    Please check the following command and let me know the status .

    Set-ADServerSettings -ViewEntireForest $true
    $FormatEnumerationLimit = -1
    $DLs  = Get-DistributionGroup -OrganizationalUnit "OU Name"  | Select-Object -ExpandProperty DistinguishedName
    foreach ($DL in $DLs)
     {
     Get-ADGroup -Identity $DL -Properties * | Select-Object name,displayname,@{Name="Primarymanager";Expression={$_.managedby -replace '^CN=|,.*$'}},@{Name="CoManager";Expression={$_.msExchCoManagedByLink -replace '^CN=|,.*$'}},@{Name="UsersAccessForDL";Expression={$_.authorig -replace '^CN=|,.*$'}},@{Name="DLAccessForDL";Expression={$_.dLMemSubmitPerms -replace '^CN=|,.*$'}} | Export-Csv c:\temp\modified.csv -Append -NoTypeInformation
     }

    Thanks & Regards S.Nithyanandham

    Monday, January 28, 2019 11:41 AM
  • Hi Dear ...

    Can we use exchange power shell module instead of AD ? because attribute ( AcceptMessagesOnlyFromSendersOrMembers) not available in GET-ADGroup .... and to remind you sir that I want the below columns in the CSV file : 

    DL name, OU, AcceptMessagesOnlyFromSendersOrMembers, ManagedBy, Count


    Monday, February 4, 2019 4:43 AM
  • Can somebody help me?
    Thursday, February 7, 2019 7:28 AM
  • Can somebody help me?
    Monday, February 11, 2019 4:42 AM