0 votes

Good Day

I've found what i want and is this Scripts Repository https://www.adaxes.com/script-repository/output-the-last-time-a-distribution-list-received-mail-s122.htm. Is for Exchange on-premises

Is it possible to make it in to a Report with the addition to add one more then one Distribution?

Thank you

by (320 points)
0

Hello,

Yes, it is possible. For us to provide you with details, please, clarify how you want to select groups for the report. Do you want to select all the groups manually or a scope (e. g. OU)? Any additional details and live examples will be much appreciated.

0

Hello

So, at the moment, a scope an OU. To be precise we have an OU where is called (Mail Distribution) and inside we have groups that are used for Distribution Mails. At a later time the multiple selection of group would not be bad idea. The Goal would be a Report were i can see when was a Distribution used to send mail. With timestamp and the name of the Group.

I hope I have provided some information.

1 Answer

0 votes
by (228k points)

Hello,

Thank you for clarifying. Here is the script for generating the report. For information on how to create reports, see https://www.adaxes.com/tutorials_ActiveDirectoryManagement_CreateReport.htm. In the script:

  • $messageDateColumnId – Specifies the identifier of the Date/time custom column that will store the mail delivery date. To get the identifier:
    1. In the Report-specific columns section, on the Columns tab, right-click the custom column.
    2. In the context menu, navigate to Copy and click Column ID.
    3. The column identifier will be copied to clipboard.
  • $exchangeServer - specifies the fully qualified domain name or IP address of your Exchange Server.
$messageDateColumnId = "{83354eeb-65f4-4fc8-a9b4-15ef27ea23d1}" # TODO: modify me
$exchangeServer = "exchangeServer.domain.com" # TODO: Modify me

$Context.DirectorySearcher.AppendFilter("(&(objectCategory=group)(mailNickname=*))")
$Context.DirectorySearcher.SearchParameters.PropertiesToLoad.Add("mail")
try
{
    # Connect to the Exchange Server
    $session = New-PSSession -connectionURI "http://$exchangeServer/powershell" -ConfigurationName Microsoft.Exchange
    Import-PSSession -session $session -AllowClobber -DisableNameChecking

    $searchIterator = $Context.DirectorySearcher.ExecuteSearch()
    while ($Context.MoveNext($searchIterator))
    {
        $searchResult = $searchIterator.Current
        $mail = $searchResult.GetPropertyByName("mail").Values[0]
        $messageTrackingLog = Get-MessageTrackingLog -Recipients $mail -ResultSize Unlimited | Select-Object sender, timestamp | Sort timestamp -Descending
        if ($NULL -eq $messageTrackingLog)
        {
            $messageDate = $NULL
        }
        else
        {
            $messageDate = $messageTrackingLog[0].TimeStamp
        }

        $Context.Items.Add($searchResult, @{$messageDateColumnId = $messageDate}, $NULL)
    }
}
finally
{
    if ($searchIterator) { $searchIterator.Dispose() }
    if ($session) { Remove-PSSession -Session $session }
}

Related questions

0 votes
1 answer

We have four OUs in Active Directory (Pending Deletion, Disabled with Mail Delegates, Disabled with HR Extensions and Disabled_Temp_Leave) that users are moved to prior to their eventual ... past 7 days have been moved to one of 4 of these OUs. Thanks!

asked Jun 3, 2021 by RayBilyk (220 points)
0 votes
1 answer

For example, if the scope is a specified OU, running the report will list management history for every object in the OU even if it has had no management operations ... so objects that have not had any recent modifications are excluded from the report results?

asked Aug 13, 2021 by ryan741 (120 points)
0 votes
1 answer

Is it possible to run a report to get users disabled in the last 24 hours?

asked Jun 10, 2020 by peggleg (110 points)
0 votes
1 answer

If the user name submitted is "jhon doe" all of the users properties will be lower case. We want it to force it to be "Jhon Doe" even if it was submitted in lower case.

asked Aug 31 by raul.ramirez (50 points)
0 votes
1 answer

Some of our users don't log on to AD ever therefore does not give us a true user picture?

asked Jun 4, 2021 by marcwoollard (40 points)
2,803 questions
2,537 answers
6,609 comments
63,143 users