Exchange – Delegate Mailbox Audit Actions Süreçleri

Bu güvenlik kontrolü, posta kutusu denetim günlüğünün, temsilci oturum açma türü için posta kutusu eylemlerinin denetimi için önerilen ayarları karşılayacak veya aşacak şekilde yapılandırılmasını sağlar. Posta kutusu denetim günlüğünün doğru tutulması, posta kutularına erişimi ve bu kutularda gerçekleştirilen eylemleri izlemek ve yetkisiz veya şüpheli etkinlikleri tespit edip araştırmak için çok önemlidir.

Bir temsilci oturum açma türü için denetim yapılması önerilen eylemler en azından şunlardır: ApplyRecord, Create, HardDelete, MailItemsAccessed, MoveToDeletedItems, SendAs, SendOnBehalf, SoftDelete, Update, UpdateFolderPermissions, UpdateInboxRules.

Kontrol başarısız olursa, temsilci oturum açma türü için tüm bu eylemlerin denetlenecek şekilde ayarlandığından emin olun.
Bu kontrolün Kullanıcı Posta Kutularını ve Paylaşılan Posta Kutularını kapsadığını unutmayın.

Delegate kullanıcı oturum açma türü için önerilen eylemleri eklemek üzere bu PowerShell scriptini çalıştırın. scriptin, zaten yapılandırdığınız tüm ek eylemleri koruduğunu ve yalnızca bu oturum açma türü için önerilen eylem listesini eklediğini unutmayın:

$UserCredential = Get-Credential

Connect-ExchangeOnline -UserPrincipalName $UserCredential.UserName -ShowProgress $true



# Define the list of recommended audit actions for delegate sign-in type mailboxes

$AuditDelegate = @("Create", "HardDelete", "MoveToDeletedItems", "MailItemsAccessed", "SendAs", "SendOnBehalf", "SoftDelete", "Update", "UpdateFolderPermissions", "UpdateInboxRules", "ApplyRecord")



function Update-DelegateAuditActions {

    param (

        [string]$Mailbox

    )



    # Get the current audit actions for delegate sign-in

    $currentAuditDelegate = (Get-Mailbox -Identity $Mailbox).AuditDelegate



    # Merge current actions with new actions, removing duplicates

    $newAuditDelegate = $currentAuditDelegate + $AuditDelegate | Select-Object -Unique



    try {

        # Try to set the new list of audit actions for delegate sign-in

        Set-Mailbox -Identity $Mailbox -AuditEnabled $true -AuditLogAgeLimit 180 -AuditDelegate $newAuditDelegate

    } catch {

        # Catch any exceptions that occur during the Set-Mailbox command

        if ($_.Exception.Message -like "*Auditing of Send event is only available for users with appropriate license*") {

            # If the specific error about the "Send" event is caught, remove "Send" from the new audit actions

            # This is because auditing the send event is not available for all licenses

            $newAuditDelegate = $newAuditDelegate | Where-Object { $_ -notlike "SendAs" -and $_ -notlike "SendOnBehalf" }

            # Try to set the audit actions again without the "SendAs" and "SendOnBehalf" actions

            Set-Mailbox -Identity $Mailbox -AuditEnabled $true -AuditLogAgeLimit 180 -AuditDelegate $newAuditDelegate

        } else {

            # If a different error occurs, rethrow the exception

            throw $_

        }

    }

}



# Retrieve all mailboxes of types: User, Shared, Room, and Discovery

$mailboxes = Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox" -or RecipientTypeDetails -eq "SharedMailbox" -or RecipientTypeDetails -eq "RoomMailbox" -or RecipientTypeDetails -eq "DiscoveryMailbox"}



# Iterate through each mailbox and update the audit actions for delegate sign-in

foreach ($mailbox in $mailboxes) {

    Update-DelegateAuditActions -Mailbox $mailbox.Identity

}

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir