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 (230 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 (220k 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 (180 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

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)
0 votes
1 answer

We just busted our licence limit of 400, but we are only 320 employees. All the extras are either service accounts, external contractors accounts or old user accounts ... is reinstated on the 'managed accounts' list? Thank you for the guidance, Louis

asked Apr 11 by lw.fa (60 points)
2,737 questions
2,471 answers
6,466 comments
1,344,927 users