# Globilisim Windows rapor araci # Tarayicinin okuyamadigi donanim bilgilerini okur ve raporu tarayicida acar. # - Yonetici yetkisi gerekmez, hicbir sey yuklenmez, hicbir ayar degistirilmez. # - Seri numarasi, kullanici adi, bilgisayar adi, dosyalar OKUNMAZ. # - Bilgiler adres cubugundaki "#" isaretinden sonra tasinir; bu kisim sunucuya gonderilmez. # Rapor sayfasinda "Anonim olarak paylas" dugmesine basmadiginiz surece hicbir veri Globilisim'e ulasmaz. # Kaynak: https://globilisim.com/rapor.ps1 $ErrorActionPreference = 'SilentlyContinue' $ProgressPreference = 'SilentlyContinue' Write-Host '' Write-Host ' Globilisim rapor araci' -ForegroundColor Cyan Write-Host ' Donanim bilgileri okunuyor (10-20 saniye)...' function Kirp($s, $n) { if ($null -eq $s) { return $null }; $t = ([string]$s).Trim(); if ($t.Length -gt $n) { $t = $t.Substring(0, $n) }; if ($t -eq '') { return $null }; return $t } $genel = @('To Be Filled By O.E.M.', 'Default string', 'System Product Name', 'System manufacturer', 'Not Applicable', 'None', 'O.E.M.') function Gecerli($s) { if ($null -eq $s) { return $null }; $t = ([string]$s).Trim(); if ($genel -contains $t -or $t -eq '') { return $null }; return $t } $r = [ordered]@{ v = 1 } # --- Bilgisayar --- $cs = Get-CimInstance Win32_ComputerSystem $csp = Get-CimInstance Win32_ComputerSystemProduct $bb = Get-CimInstance Win32_BaseBoard $enc = Get-CimInstance Win32_SystemEnclosure $uretici = Gecerli $cs.Manufacturer $model = Gecerli $cs.Model # Lenovo makine tipini (82KU) Model'e, ticari adi (IdeaPad 5 15ALC05) Version'a yazar if ($uretici -match 'LENOVO' -and (Gecerli $csp.Version)) { $model = Gecerli $csp.Version } $kasa = $null $tipler = @($enc.ChassisTypes) if ($cs.PCSystemType -eq 2 -or ($tipler | Where-Object { @(8,9,10,11,12,14,18,21,30,31,32) -contains $_ })) { $kasa = 'dizustu' } elseif ($tipler | Where-Object { @(3,4,5,6,7,13,15,16,24,35,36) -contains $_ }) { $kasa = 'masaustu' } $r.pc = [ordered]@{ u = Kirp $uretici 40; m = Kirp $model 60; a = Kirp (Gecerli $cs.SystemFamily) 60; k = $kasa ak = Kirp (Gecerli $bb.Manufacturer) 40; am = Kirp (Gecerli $bb.Product) 60 } # --- Islemci --- $cpu = Get-CimInstance Win32_Processor | Select-Object -First 1 $r.cpu = [ordered]@{ n = Kirp (($cpu.Name -replace '\s+', ' ')) 80; c = [int]$cpu.NumberOfCores; t = [int]$cpu.NumberOfLogicalProcessors; f = [int]$cpu.MaxClockSpeed } # --- Bellek --- $moduller = @(Get-CimInstance Win32_PhysicalMemory) $yuvalar = (Get-CimInstance Win32_PhysicalMemoryArray | Measure-Object -Property MemoryDevices -Sum).Sum $tip = @{ 20 = 'DDR'; 21 = 'DDR2'; 24 = 'DDR3'; 26 = 'DDR4'; 34 = 'DDR5'; 35 = 'LPDDR5' } $r.ram = [ordered]@{ g = [math]::Round(($moduller | Measure-Object -Property Capacity -Sum).Sum / 1GB, 1) y = [int]$yuvalar h = @($moduller | ForEach-Object { $t = $null; if ($tip.ContainsKey([int]$_.SMBIOSMemoryType)) { $t = $tip[[int]$_.SMBIOSMemoryType] } $hz = [int]$_.ConfiguredClockSpeed; if (-not $hz) { $hz = [int]$_.Speed } [ordered]@{ g = [math]::Round($_.Capacity / 1GB, 1); s = $hz; t = $t; u = Kirp (Gecerli $_.Manufacturer) 30; p = Kirp (Gecerli $_.PartNumber) 30 } }) } # --- Ekran karti (gercek bellek miktari kayit defterinden; WMI 4 GB ile sinirli) --- $vram = @{} Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}' | ForEach-Object { $p = Get-ItemProperty $_.PSPath if ($p.DriverDesc -and $p.'HardwareInformation.qwMemorySize') { $vram[$p.DriverDesc] = [math]::Round([double]$p.'HardwareInformation.qwMemorySize' / 1MB) } } $r.gpu = @(Get-CimInstance Win32_VideoController | Where-Object { $_.Name -notmatch 'Remote|Mirage|Virtual Display|Parsec|Meta Virtual' } | ForEach-Object { $mb = $vram[$_.Name]; if (-not $mb -and $_.AdapterRAM -gt 0) { $mb = [math]::Round($_.AdapterRAM / 1MB) } [ordered]@{ n = Kirp $_.Name 80; v = $mb; d = Kirp $_.DriverVersion 30; w = [int]$_.CurrentHorizontalResolution; h = [int]$_.CurrentVerticalResolution; z = [int]$_.CurrentRefreshRate } }) # --- Depolama --- $r.disk = @(Get-PhysicalDisk | Sort-Object DeviceId | ForEach-Object { $d = $_ $sag = $null try { $sag = $d | Get-StorageReliabilityCounter -ErrorAction Stop } catch { } $tur = [string]$d.MediaType; if ($tur -eq 'Unspecified') { $tur = $null } # Eski diskler turunu bildirmeyebilir: donus hizi veya model adindan tahmin if (-not $tur -and $d.SpindleSpeed -gt 0 -and $d.SpindleSpeed -lt 100000) { $tur = 'HDD' } if (-not $tur -and $d.FriendlyName -match 'SSD|NVMe|M\.2') { $tur = 'SSD' } if (-not $tur -and $d.FriendlyName -match '^(WDC |WD\d|ST\d|HGST|TOSHIBA (DT|MQ|HDW)|Hitachi|SAMSUNG HD|HDD)') { $tur = 'HDD' } [ordered]@{ n = Kirp $d.FriendlyName 60; t = $tur; b = Kirp ([string]$d.BusType) 12; g = [math]::Round($d.Size / 1GB) s = Kirp ([string]$d.HealthStatus) 16 a = $(if ($sag -and $null -ne $sag.Wear) { [int]$sag.Wear } else { $null }) c = $(if ($sag -and $sag.Temperature) { [int]$sag.Temperature } else { $null }) o = $(if ($sag -and $sag.PowerOnHours) { [int]$sag.PowerOnHours } else { $null }) } }) # --- Pil --- $pil = $null if (Get-CimInstance Win32_Battery) { $tasarim = (Get-CimInstance -Namespace root\wmi -ClassName BatteryStaticData | Select-Object -First 1).DesignedCapacity $tam = (Get-CimInstance -Namespace root\wmi -ClassName BatteryFullChargedCapacity | Select-Object -First 1).FullChargedCapacity $dongu = (Get-CimInstance -Namespace root\wmi -ClassName BatteryCycleCount | Select-Object -First 1).CycleCount if (-not $tasarim -or -not $tam) { # Yedek yol: Windows pil raporu (yonetici gerekmez) $x = Join-Path $env:TEMP ('gs-pil-' + [guid]::NewGuid().ToString('N') + '.xml') powercfg /batteryreport /xml /output "$x" | Out-Null if (Test-Path $x) { [xml]$b = Get-Content $x $p = $b.BatteryReport.Batteries.Battery | Select-Object -First 1 if ($p) { $tasarim = [int]$p.DesignCapacity; $tam = [int]$p.FullChargeCapacity; if (-not $dongu) { $dongu = [int]$p.CycleCount } } Remove-Item $x -Force } } $pil = [ordered]@{ d = [int]$tasarim; f = [int]$tam; c = [int]$dongu } } $r.pil = $pil # --- Isletim sistemi --- $os = Get-CimInstance Win32_OperatingSystem $r.os = [ordered]@{ n = Kirp $os.Caption 60; b = Kirp $os.BuildNumber 10; y = $(if ($os.InstallDate) { $os.InstallDate.Year } else { $null }); m = Kirp $os.OSArchitecture 12 } # --- Durum: depolama dolulugu, acilis, son guncelleme, guvenlik (yonetici gerektirmeyenler) --- function Epoch($t) { if ($t) { return [int64](($t.ToUniversalTime() - [datetime]'1970-01-01').TotalSeconds) } else { return $null } } $c = Get-CimInstance Win32_LogicalDisk -Filter "DeviceID='C:'" $r.depo = $(if ($c.Size) { [ordered]@{ t = [math]::Round($c.Size / 1GB); b = [math]::Round($c.FreeSpace / 1GB) } } else { $null }) $r.acilis = Epoch $os.LastBootUpTime $son = Get-HotFix | Where-Object { $_.InstalledOn } | Sort-Object InstalledOn -Descending | Select-Object -First 1 $r.guncel = Epoch $son.InstalledOn $guv = [ordered]@{ av = $null; bl = $null; sb = $null; tpm = $null } try { $m = Get-MpComputerStatus -ErrorAction Stop; $guv.av = [bool]($m.AntivirusEnabled -and $m.RealTimeProtectionEnabled) } catch { } try { # BitLocker durumu yonetici gerektirmeyen kabuk ozelliginden: 1 acik, 2 kapali, 3 sifreleniyor, 5 askida, 6 acik (kilitli degil) $v = (New-Object -ComObject Shell.Application).NameSpace('C:').Self.ExtendedProperty('System.Volume.BitLockerProtection') if ($v -ne $null) { $guv.bl = @(1, 3, 6) -contains [int]$v } } catch { } try { $guv.sb = [bool](Confirm-SecureBootUEFI -ErrorAction Stop) } catch { } try { $t = Get-CimInstance -Namespace root\cimv2\Security\MicrosoftTpm -ClassName Win32_Tpm -ErrorAction Stop; if ($t) { $guv.tpm = Kirp ([string]$t.SpecVersion).Split(',')[0] 10 } } catch { } $r.guv = $guv # --- Bluetooth: yalnizca adaptor adi ve durumu (eslesmis cihaz adlari ve adresler ALINMAZ) --- $r.bt = $null try { $bt = @(Get-PnpDevice -Class Bluetooth -ErrorAction Stop | Where-Object { $_.InstanceId -notmatch '^(BTH|BTHENUM|BTHLE|BTHLEDEVICE|BTHHFENUM)\\' -and $_.FriendlyName -notmatch 'Enumerator|RFCOMM|Microsoft Bluetooth LE' }) $ad = $bt | Where-Object { $_.Present } | Select-Object -First 1 if (-not $ad) { $ad = $bt | Select-Object -First 1 } if ($ad) { $esli = @(Get-PnpDevice -Class Bluetooth -PresentOnly -ErrorAction SilentlyContinue | Where-Object { $_.InstanceId -match '^(BTHENUM|BTHLE)\\DEV_' }).Count $r.bt = [ordered]@{ v = $true; c = Kirp $ad.FriendlyName 60; d = $(if ($ad.Present -and $ad.Status -eq 'OK') { $true } elseif ($ad.Present) { $false } else { $null }); e = $esli } } else { $r.bt = [ordered]@{ v = $false } } } catch { } # --- Ozet ve tarayicida acma --- $json = $r | ConvertTo-Json -Depth 5 -Compress $bayt = [Text.Encoding]::UTF8.GetBytes($json) $ms = New-Object IO.MemoryStream $gz = New-Object IO.Compression.GZipStream($ms, [IO.Compression.CompressionMode]::Compress) $gz.Write($bayt, 0, $bayt.Length); $gz.Close() $b64 = [Convert]::ToBase64String($ms.ToArray()).TrimEnd('=').Replace('+', '-').Replace('/', '_') $adres = 'https://globilisim.com/rapor#v1.' + $b64 Write-Host '' Write-Host (' Bilgisayar : ' + $r.pc.u + ' ' + $r.pc.m) Write-Host (' Islemci : ' + $r.cpu.n) Write-Host (' Bellek : ' + $r.ram.g + ' GB') foreach ($g in $r.gpu) { Write-Host (' Ekran karti: ' + $g.n) } foreach ($d in $r.disk) { Write-Host (' Disk : ' + $d.n + ' (' + $d.g + ' GB)') } if ($pil -and $pil.d -gt 0 -and $pil.f -gt 0) { Write-Host (' Pil sagligi: %' + [math]::Round($pil.f / $pil.d * 100)) } Write-Host '' Write-Host ' Ayrintili rapor tarayicinizda aciliyor...' -ForegroundColor Green Start-Process $adres