Загрузка данных


# Скрипт администратора для отключения персонализации и Microsoft Store
# Запустить от имени администратора (Run as Administrator)

# Проверка прав администратора
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
    Write-Host "Ошибка: Скрипт должен быть запущен от имени администратора!" -ForegroundColor Red
    exit
}

Write-Host "Применение групповых политик..." -ForegroundColor Green

# Отключение персонализации рабочего стола
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v NoChangingWallpaper /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v NoChangingColors /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v NoChangingLockScreen /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop" /v NoChangingWallPaper /t REG_DWORD /d 1 /f

# Отключение Microsoft Store
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore" /v RemoveWindowsStore /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Storefront" /v DisableStoreApps /t REG_DWORD /d 1 /f

# Отключение предложения резервного копирования (OneDrive Backup) при входе
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /v DisableFileSyncNGSC /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /v KFMBlockOptIn /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /v KFMShowNotification /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive" /v DisablePersonalSync /t REG_DWORD /d 1 /f

# Включение удалённого рабочего стола (Remote Desktop)
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

# Обновление групповых политик
gpupdate /force

Write-Host "Готово! Персонализация, Microsoft Store, предложение резервного копирования отключены, удалённый рабочий стол включён." -ForegroundColor Green
Write-Host "Рекомендуется перезагрузить компьютер." -ForegroundColor Yellow