Bu güvenlik kontrolü, posta kutusu denetim günlüğünün, bir yönetici 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ındaki erişim ve gerçekleştirilen eylemlerin izlenmesi ve yetkisiz veya şüpheli etkinliklerin tespit edilip araştırılması için çok önemlidir.
Bir yönetici oturum açma türü için önerilen denetim eylemleri en azından şunlardır: ApplyRecord, Create, HardDelete, MailItemsAccessed, MoveToDeletedItems, SendAs, SendOnBehalf, SoftDelete, Update, UpdateCalendarDelegation, UpdateFolderPermissions, UpdateInboxRules.
Kontrol başarısız olursa, yönetici 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.
Yönetici kullanıcı oturum açma türü için önerilen eylemleri eklemek üzere bu PowerShell scriptini çalıştırın. Scriptin, önceden 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 admin sign-in type mailboxes
$AuditAdmin = @("ApplyRecord", "Create", "HardDelete", "MailItemsAccessed", "MoveToDeletedItems", "SendAs", "SendOnBehalf", "SoftDelete", "Update", "UpdateCalendarDelegation", "UpdateFolderPermissions", "UpdateInboxRules")
function Update-AdminAuditActions {
param (
[string]$Mailbox
)
# Get the current audit actions for admin sign-in
$currentAuditAdmin = (Get-Mailbox -Identity $Mailbox).AuditAdmin
# Merge current actions with new actions, removing duplicates
$newAuditAdmin = $currentAuditAdmin + $AuditAdmin | Select-Object -Unique
try {
# Try to set the new list of audit actions for admin sign-in
Set-Mailbox -Identity $Mailbox -AuditEnabled $true -AuditLogAgeLimit 180 -AuditAdmin $newAuditAdmin
} 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 "SendAs" and "SendOnBehalf" from the new audit actions
# This is because auditing the send event is not available for all licenses
$newAuditAdmin = $newAuditAdmin | 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 -AuditAdmin $newAuditAdmin
} 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 admin sign-in
foreach ($mailbox in $mailboxes) {
Update-AdminAuditActions -Mailbox $mailbox.Identity
}