✅ 一键禁用 Server 2022 多余后台服务(不影响网站)

✅ 一键禁用 Server 2022 多余后台服务(不影响网站)

1777706073133

 

Write-Host "正在禁用服务器多余后台服务..." -ForegroundColor Cyan;
# 1. 禁用Windows Defender实时保护(仅服务器用,不影响网站)
Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue;
# 2. 禁用打印服务(网站服务器一般用不到)
Stop-Service -Name Spooler -Force -ErrorAction SilentlyContinue; Set-Service -Name Spooler -StartupType Disabled;
# 3. 禁用远程注册表服务(降低被攻击风险)
Stop-Service -Name RemoteRegistry -Force -ErrorAction SilentlyContinue; Set-Service -Name RemoteRegistry -StartupType Disabled;
# 4. 禁用Windows Search(服务器不需要文件索引)
Stop-Service -Name WSearch -Force -ErrorAction SilentlyContinue; Set-Service -Name WSearch -StartupType Disabled;
# 5. 禁用Superfetch/ SysMain(降低磁盘占用,提升性能)
Stop-Service -Name SysMain -Force -ErrorAction SilentlyContinue; Set-Service -Name SysMain -StartupType Disabled;
# 6. 禁用后台错误报告
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Force | New-ItemProperty -Name Disabled -Value 1 -PropertyType DWord -Force;
Write-Host "✅ 多余后台服务已禁用,不影响网站访问!" -ForegroundColor Green

以下版本正在测试

© 版权声明
THE END
喜欢就支持一下吧
点赞139W+ 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容