Computer >> Hướng Dẫn Máy Tính >  >> Xử Lý Sự Cố >> Bảo Trì Máy Tính

Khắc phục lỗi "Server Requires Restart" khi thêm Roles & Features trên Windows Server 2016

Sửa lỗi không thể Add Roles/Features: "The operation cannot be completed, because the server requires a restart"

Lỗi này xảy ra trên Server 2016/2012, vẫn còn sau khi restart và cài update. Event Viewer ghi nhận lỗi Event 7041: Service MSSQL$MICROSOFT##WID không có quyền "Log on as a service".

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

Gợi ý: Thử restart dịch vụ Remote Registry trước. Nếu thất bại, làm theo dưới.

Giải pháp: Cấp quyền "Log on as a service" cho NT SERVICE\ALL SERVICES và NT SERVICE\MSSQL$MICROSOFT##WID.

Trường hợp A: Server trong Domain (sửa Default Domain Controller Policy)

  1. Win + R → gpmc.msc → Enter.

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

  1. Điều hướng: Forest → Domains → "Tên Domain" → Domain Controllers.
  2. Chuột phải Default Domain Controller Policy → Edit.

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

  1. Chuyển đến Bước 4 dưới.

Trường hợp B: Local Server (sửa Local Group Policy)

  1. Win + R → gpedit.msc → Enter.

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

  1. Điều hướng: Computer Configuration → Windows Settings → Security Settings → Local Policies → User Rights Assignment.

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

Bước chung (cả 2 trường hợp):

  1. Double-click Log on as a service.

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

  1. Nhấn Add User or Group.

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

  1. Nhập NT SERVICE\ALL SERVICES → OK.

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

  1. OK → đóng Group Policy Editor.

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

  1. CMD Admin → chạy gpupdate /force.

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

  1. Reboot Server.
  1. Mở lại Group Policy Management → User Rights Assignments.
  2. Double-click Log on as a service → Add User or Group.
  3. Nhập NT SERVICE\MSSQL$MICROSOFT##WID → OK.

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

Nếu không thêm được 2 tài khoản trên:

  1. Thêm "Everyone" vào Log on as service.
  2. Reboot Server.
  3. Thêm "NT SERVICE\ALL SERVICES" và "NT SERVICE\MSSQL$MICROSOFT##WID".
  4. Chạy gpupdate /force.
  5. Reboot Server.
  6. Xóa "Everyone" khỏi Log on as service.
  7. Tiến hành Add Roles and Features.
  1. OK → đóng Group Policy Editor.

Khắc phục lỗi  Server Requires Restart  khi thêm Roles & Features trên Windows Server 2016

  1. CMD Admin → gpupdate /force.
  2. Reboot Server.
  3. Thử Add Roles and Features.