Bobcares

How to fix the error unable to add or remove role: windows server requires restart

by | Nov 3, 2020

While installing any role or feature on the Windows server, webmasters often face the error it is unable to add or remove role: windows server requires a restart.

As a part of our Server Management Services, we help our Customers with Windows related errors regularly.

Let us today discuss the possible causes and fixes for this error.

Unable to add or remove role: windows server requires restart

At times, while installing any role or feature on Windows Server 2016, an error appears that the server requires a restart. The exact error message looks like the one below:

The request to add or remove features on the specified server failed. The operation cannot be completed, because the server that you specified requires a restart.

The same error appears again while installing the role, even after restarting the server.

As a result, we cannot install or remove any of the roles/features on Windows Server even after restarting the server and installing the latest updates.

The server event log at the Event Viewer -> Windows Logs -> System shows an error with the EventID 7041 and Service Control Manager as a source. The event description says:

This service account does not have the required user right “Log on as a service”.

 

How to fix the error “Unable to add or remove role: windows server requires restart”?

To solve the problem, we must grant the logon as a service permissions to “NT SERVICE\ALL SERVICES”.

  1. Open the Local Group Policy Editor:
    gpedit.msc
  2. Go to Computer Configuration, navigate to Local Policies in the Windows Settings Security Settings, and then to the User Rights Assignment
  3. Find the Log on as a service policy
  4. We may see that there is no NT SERVICE\ALL SERVICES in this policy. We can add it from the Add User or Group -> NT SERVICE\ALL SERVICES.

Often it may trigger an error “name not found”. Thus, we may need to grant the “Log on as a service” permissions to NT SERVICE\ALL SERVICES.

For this, we can use the ntrights.exe tool from the old Windows Server 2003 Resource Kit.

Download and install the Server 2003 Resource Kit (rktools.exe). Then grant the SeServiceLogonRight permission using these commands in the elevated command prompt:

cd “C:\Program Files (x86)\Windows Resource Kits\Tools”
ntrights.exe +r SeServiceLogonRight -u “NT SERVICE\ALL SERVICES”

We may now receive a message that granting SeServiceLogonRight to NT SERVICE\ALL SERVICES was successful.

Unable to add or remove role: windows server requires restart

Make sure that NT SERVICE\ALL SERVICES has appeared in the “Log on as a service” permissions in the Group Policy Editor console.

Restart the Windows Server and try to install/remove a role again. No errors should appear.

[Need any further assistance to install a feature on the Windows server? – We’re available 24*7]

 

Conclusion

In short, we can fix the error unable to add or remove role: windows server requires to restart by granting SeServiceLogonRight to NT SERVICE\ALL SERVICES. Today, we saw how our Support Engineers fix this error.

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.