Windows Server
In Place Check
Şu an in place check işlemi yapıyoruz
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
<# .SYNOPSIS Windows Server 2022 Post-Upgrade Check Script Açıklama: In-place upgrade sonrası sistem sağlığını doğrular. #> $Results = @() Write-Host "--- Windows Server 2022 Upgrade Kontrolü Başlatılıyor ---" -ForegroundColor Cyan # 1. İşletim Sistemi Versiyon Kontrolü $OSInfo = Get-ComputerInfo -Property WindowsProductName, WindowsVersion, OsBuildNumber $Results += [PSCustomObject]@{Kontrol = "İşletim Sistemi"; Durum = $OSInfo.WindowsProductName; Detay = "Build: $($OSInfo.OsBuildNumber)"} # 2. Aktivasyon Durumu $License = Get-CimInstance SoftwareLicensingProduct -Filter "PartialProductKey IS NOT NULL" | Where-Object { $_.Name -like "*Windows*" } $Status = if ($License.LicenseStatus -eq 1) { "Aktif" } else { "HATA: Aktif Değil" } $Results += [PSCustomObject]@{Kontrol = "Lisans Aktivasyonu"; Durum = $Status; Detay = "LicenseStatus: $($License.LicenseStatus)"} # 3. SCCM Client Sağlığı $CCMStatus = Get-Service -Name "CcmExec" -ErrorAction SilentlyContinue if ($CCMStatus.Status -eq "Running") { $Results += [PSCustomObject]@{Kontrol = "SCCM Client (CcmExec)"; Durum = "Çalışıyor"; Detay = "Servis Aktif"} } else { $Results += [PSCustomObject]@{Kontrol = "SCCM Client (CcmExec)"; Durum = "HATA"; Detay = "Servis Çalışmıyor!"} } # 4. WMI Sağlık Kontrolü try { $WMI = Get-CimInstance -ClassName Win32_OperatingSystem -ErrorAction Stop $Results += [PSCustomObject]@{Kontrol = "WMI Sağlığı"; Durum = "OK"; Detay = "Sorgulama Başarılı"} } catch { $Results += [PSCustomObject]@{Kontrol = "WMI Sağlığı"; Durum = "HATA"; Detay = "WMI Sorgusu Başarısız!"} } # 5. Bekleyen Yeniden Başlatma (Pending Reboot) $Pending = Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" $RebootStatus = if ($Pending) { "Evet" } else { "Hayır" } $Results += [PSCustomObject]@{Kontrol = "Bekleyen Yeniden Başlatma"; Durum = $RebootStatus; Detay = "-"} # Sonuçları Ekrana Yazdır Write-Host "`n--- KONTROL SONUÇLARI ---" -ForegroundColor Yellow $Results | Format-Table -AutoSize # Hata Özeti (Setup Loglarını Kontrol Et) if (Test-Path "C:\Windows\Panther\setuperr.log") { $Errors = Get-Content "C:\Windows\Panther\setuperr.log" -ErrorAction SilentlyContinue if ($Errors) { Write-Host "`n[!] Setup Loglarında Hatalar Bulundu (C:\Windows\Panther\setuperr.log):" -ForegroundColor Red $Errors | Select-Object -Last 5 } } |