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”.
- Open the Local Group Policy Editor:
gpedit.msc - Go to Computer Configuration, navigate to Local Policies in the Windows Settings Security Settings, and then to the User Rights Assignment
- Find the Log on as a service policy
- 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.
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.
0 Comments