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 (340 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 (270k 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 (230 points)
0 votes
1 answer

Hello, you helped us with a script to set the oof-message. Now we want to know, if it's possible to activate/deactivate the mail-forwarding option time-based. In the ... deactivate it accordingly on "param-abw-ende" Can you help me with that? Thanks Carsten

asked Nov 17, 2022 by lohnag (140 points)
0 votes
1 answer

Hi, we currenlty have a business rule to send an email everytime the Title, Manager, Department, accountExpires, EmployeeType or FirstName attributes are ... Unit: %BusinessUnit% End Date: %accountExpires% Effective Date of Change: %adm-CustomAttributeDate2%

asked Feb 14 by KevC (60 points)
0 votes
1 answer

Hi, I've tried to modify a existing report to my needs, without success. The requirement ist to see the add/moved from a group. Like here: Would this be possible with Adaxes? Thanks

asked Feb 20, 2023 by boris (450 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)
3,326 questions
3,026 answers
7,727 comments
544,678 users