@echo off
title Windows 11 Ortak Ag Ayarlari - Geri Alma
color 0E
setlocal

net session >nul 2>&1
if %errorlevel% neq 0 (
  echo.
  echo Yonetici yetkisi gerekiyor. Onay penceresinde EVET deyin...
  powershell -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
  exit /b
)

cls
echo ============================================================
echo   WINDOWS 11 ORTAK AG AYARLARI - GERI ALMA
echo   bilgisayarborsasi.com.tr
echo ============================================================
echo.
echo  Duzeltme aracinin actigi guvenlik gevsetmelerini kapatir:
echo    - Guvenli olmayan konuk oturumlari KAPATILIR
echo    - SMB imzalama zorunlulugu GERI GETIRILIR
echo    - Ag kesfi guvenlik duvari izni KAPATILIR
echo.
echo  Bundan sonra ortak klasore erisim tekrar calismayabilir.
echo.
choice /c EH /n /m "Devam edilsin mi? (E=Evet / H=Hayir): "
if errorlevel 2 exit /b
echo.

echo [1/3] Konuk oturumlari kapatiliyor...
reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v AllowInsecureGuestAuth /t REG_DWORD /d 0 /f >nul 2>&1
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation" /v AllowInsecureGuestAuth /f >nul 2>&1
powershell -NoProfile -Command "Set-SmbClientConfiguration -EnableInsecureGuestLogons $false -Force" >nul 2>&1
echo      TAMAM

echo [2/3] SMB imzalama zorunlulugu geri getiriliyor...
powershell -NoProfile -Command "Set-SmbClientConfiguration -RequireSecuritySignature $true -Force" >nul 2>&1
powershell -NoProfile -Command "Set-SmbServerConfiguration -RequireSecuritySignature $true -Force" >nul 2>&1
echo      TAMAM

echo [3/3] Ag kesfi guvenlik duvari izni kapatiliyor...
netsh advfirewall firewall set rule group="@FirewallAPI.dll,-32752" new enable=No >nul 2>&1
echo      TAMAM

echo.
echo  Geri alma tamamlandi. Bilgisayari yeniden baslatin.
echo.
pause
