🌟 善无痕蛇无泪

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

神人佛
🕐 2026-05-02 15:01 👁️ 0 浏览

✅ 一键禁用 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:SOFTWAREMicrosoftWindowsWindows Error Reporting" -Force | New-ItemProperty -Name Disabled -Value 1 -PropertyType DWord -Force;
Write-Host "✅ 多余后台服务已禁用,不影响网站访问!" -ForegroundColor Green

以下版本正在测试

📰 生成文章海报
正在生成海报...
分类: 优化教程
💬 精彩评论 0条
还没有评论,快来抢沙发吧~

发表评论

你的邮箱地址不会被公开,带 * 为必填项

上一篇
✅ 一键禁用系统更新 + 遥测上报(管理员PowerShell运行)
下一篇
✅ 一键防内存被攻击爆满防护脚本(管理员PowerShell直接运行)
👥 总访问: 1.6K
|
📅 今日: 968
|
🟢 在线: 1
网页: ...
|
🖥️ 服务: 0.024秒
|
💾 内存: 3.62M
|
📊 查询: 52次