Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows Server 2016 / Unable to Add/Remove Role: Windows Server Requires Restart

December 4, 2020 Windows Server 2016Windows Server 2019

Unable to Add/Remove Role: Windows Server Requires Restart

When installing any role or feature on Windows Server 2016, an error appears that the server requires a restart: “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”. OK, we restart our server and try to install a role again. The same error appears. And so it goes repeatedly .

Windows Server Feature Installation error "The request to add or remove features on the specified server failed, because the server requires a restart"

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 (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".

To solve the problem, you must grant the logon as a service permissions to “NT SERVICE\ALL SERVICES” (and NT SERVICE\MSSQL$MICROSOFT##WID, if the error is related to the installation of the WSUS role or SQL Server role).

  1. Open the Local Group Policy Editor: gpedit.msc
  2. Go to Computer Configuration –> Windows Settings –> Security Settings –> Local Policies –> User Rights Assignment;
  3. Find the Log on as a service policy;
  4. As you can see, there is no NT SERVICE\ALL SERVICES in this policy. Let’s try to add it: Add User or Group -> NT SERVICE\ALL SERVICES. An error occurs: name not found.
    gpo - NT SERVICE\ALL SERVICE name not found

How can you add a service account to a local policy? The only possible way I could find to grant the “Log on as a service” permissions to NT SERVICE\ALL SERVICES is to 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”

Granting SeServiceLogonRight to NT SERVICE\ALL SERVICES ... successful

ntrights.exe SeServiceLogonRight to NT SERVICE\ALL SERVICES

If there is no NETWORK SERVICE in the current permissions list, add this account as well. If necessary, add the permissions for NT SERVICE\MSSQL$MICROSOFT##WID in the same way:

ntrights.exe +r SeServiceLogonRight -u “NT SERVICE\MSSQL$MICROSOFT##WID”

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

Log on as a service local policy

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

7 comments
6
Facebook Twitter Google + Pinterest
previous post
Using Saved Queries in ADUC MMC (Active Directory User and Computers)
next post
Securing RDP Connections with Trusted SSL/TLS Certificates

Related Reading

Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

November 7, 2023

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

How to View and Change BIOS (UEFI) Settings...

September 13, 2023

7 comments

Wincent January 19, 2021 - 6:33 am

Good day.

Do you perhaps have a working link for the Windows Server 2003 Resource Kit?

I have scoured the internet with no luck of finding it

Reply
Frank December 13, 2021 - 12:01 pm

Try this: http://pub.agrarix.net/Windows/Windows%20Server%202003%20Resource%20Kit%20Tools/

Reply
Tim May 13, 2021 - 3:47 pm

I love using ntrights, as it’s from MS… but it’s not included anywhere any more, to my knowledge.
And I can’t believe how monumentally crippled Powershell seems to be in trying to add something like a privilege to a user.

Reply
Mark May 25, 2021 - 4:23 pm

Thanks for the article. Saved me from a major headache.

Reply
Augusto Cesar May 1, 2022 - 12:13 pm

It´s a security risk but you could add “everyone” , I did it and solve my problem without ntrights tool.

Reply
Brian June 29, 2022 - 9:27 pm

Hi… I did this but it did not work…. I even tried my mans suggestion above me….

Reply
James December 28, 2022 - 8:49 pm

This article worked for me, great job and a great find as most posts on other sites only state (over and over again) to uninstall/re-install WSUS and if that didn’t work you did those steps wrong. Good Article, thanks!

BTW – I found the Kit here : https://gist.github.com/eyecatchup/0107bab3d92473cb8a3d3547848fc442

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Convert (Upgrade) Windows Server 2019/2016 Evaluation to Full Version?
  • How to Clean Up Large System Volume Information Folder on Windows?
  • Fixing “Winload.efi is Missing or Contains Errors” in Windows 10
  • How to Install and Activate the RDS Licensing Role and CALs on Windows Server 2019/2016?
  • How to Connect L2TP/IPSec VPN Server From Windows
  • How to Clean Up and Compress the WinSxS Folder on Windows 10/Windows Server?
  • Managing Printers and Drivers with PowerShell in Windows 10 / Server 2016
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top