<# .SYNOPSIS Bölüm 06 · Adım 6.2 — Auto-Labeling, TTK 10 Yıl Kayıt / KVKK 2 Yıl İmha, Protection Alerts ve eDiscovery .DESCRIPTION ExchangeOnlineManagement v3.9+ (-EnableSearchOnlySession) ile Auto-Labeling, TTK 10 Yıl Saklama Politikası, 2 Retention/Record etiketi, 2 Protection Alert (-ThreatType Activity) ve eDiscovery iç denetim vakasını oluşturur. .EXAMPLE pwsh -ExecutionPolicy Bypass -File "D:\Lab\Scripts\02-Deploy-Purview-Full-Ecosystem.ps1" -AdminUpn "admin@contoso.onmicrosoft.com" #> param( [Parameter(Mandatory)][string]$AdminUpn ) $ErrorActionPreference = 'Stop' Import-Module ExchangeOnlineManagement Connect-IPPSSession -UserPrincipalName $AdminUpn -EnableSearchOnlySession -ShowBanner:$false Write-Host "[1/4] Auto-Labeling (Simulation) oluşturuluyor..." -ForegroundColor Cyan if (-not (Get-AutoSensitivityLabelPolicy -Identity 'AutoLabel-01-KVKK-ve-EPDK-CokGizli' -ErrorAction SilentlyContinue)) { New-AutoSensitivityLabelPolicy -Name 'AutoLabel-01-KVKK-ve-EPDK-CokGizli' -ApplySensitivityLabel 'Lab-Cok-Gizli' ` -ExchangeLocation 'All' -SharePointLocation 'All' -OneDriveLocation 'All' -Mode 'TestWithoutNotifications' | Out-Null New-AutoSensitivityLabelRule -Name 'Rule-AutoLabel-KVKK-EPDK' -Policy 'AutoLabel-01-KVKK-ve-EPDK-CokGizli' -Workload 'SharePoint' ` -ContentContainsSensitiveInformation @(@{ Name = 'TR-KVKK-Ozel-Nitelikli-Saglik-Verisi'; minCount = '1'; confidencelevel = 'Medium' }) | Out-Null } Write-Host "[2/4] Data Lifecycle & Records Management (TTK 10 Yıl + KVKK 2 Yıl)..." -ForegroundColor Cyan if (-not (Get-RetentionCompliancePolicy -Identity 'RET-01-TTK-Mali-10Yil-Saklama' -ErrorAction SilentlyContinue)) { New-RetentionCompliancePolicy -Name 'RET-01-TTK-Mali-10Yil-Saklama' -ExchangeLocation 'All' -SharePointLocation 'All' -OneDriveLocation 'All' -Enabled $true | Out-Null New-RetentionComplianceRule -Name 'Rule-TTK-10Yil' -Policy 'RET-01-TTK-Mali-10Yil-Saklama' -RetentionDuration 3650 -RetentionComplianceAction 'Keep' | Out-Null } if (-not (Get-ComplianceTag -Identity 'Etiket-TTK-10Yil-Degistirilemez-Kayit' -ErrorAction SilentlyContinue)) { New-ComplianceTag -Name 'Etiket-TTK-10Yil-Degistirilemez-Kayit' -RetentionDuration 3650 -RetentionAction 'Keep' -IsRecordLabel $true | Out-Null } if (-not (Get-ComplianceTag -Identity 'Etiket-KVKK-2Yil-Sakla-ve-ImhaEt' -ErrorAction SilentlyContinue)) { New-ComplianceTag -Name 'Etiket-KVKK-2Yil-Sakla-ve-ImhaEt' -RetentionDuration 730 -RetentionAction 'KeepAndDelete' | Out-Null } Write-Host "[3/4] Protection Alerts (-ThreatType Activity)..." -ForegroundColor Cyan if (-not (Get-ProtectionAlert -Identity 'Alert-Purview-Etiket-Dusurme-Downgrade' -ErrorAction SilentlyContinue)) { New-ProtectionAlert -Name 'Alert-Purview-Etiket-Dusurme-Downgrade' -ThreatType 'Activity' -Category 'DataGovernance' ` -Severity 'High' -Operation 'SensitivityLabelUpdated' -AggregationType 'SimpleAggregation' -Threshold 3 -TimeWindow 60 -NotifyUser $AdminUpn | Out-Null } if (-not (Get-ProtectionAlert -Identity 'Alert-Purview-Toplu-Dosya-Silme' -ErrorAction SilentlyContinue)) { New-ProtectionAlert -Name 'Alert-Purview-Toplu-Dosya-Silme' -ThreatType 'Activity' -Category 'ThreatManagement' ` -Severity 'High' -Operation 'FileDeleted' -AggregationType 'SimpleAggregation' -Threshold 10 -TimeWindow 60 -NotifyUser $AdminUpn | Out-Null } Write-Host "[4/4] eDiscovery İç Denetim Vakası..." -ForegroundColor Cyan if (-not (Get-ComplianceCase -Identity 'Case-2026-KVKK-Ic-Denetim-Tatbikati' -ErrorAction SilentlyContinue)) { New-ComplianceCase -Name 'Case-2026-KVKK-Ic-Denetim-Tatbikati' -Description 'KVKK ve BDDK uyumluluk ic denetim tatbikati' | Out-Null } Get-ComplianceTag | Select-Object Name, RetentionDuration, RetentionAction, IsRecordLabel | Format-Table -AutoSize Get-ComplianceCase | Select-Object Name, Status | Format-Table -AutoSize