Windows OS Hub
  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange

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

August 24, 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.

1 comment
4
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

Preparing Windows for Adobe Flash End of Life...

January 22, 2021

How to Disable/Remove Thumbs.db File on Network Folders...

January 21, 2021

MS SQL Server 2019 Installation Guide: Basic Settings...

January 19, 2021

USB Device Passthrough (Redirect) to Hyper-V Virtual Machine

January 15, 2021

How to Enable and Configure User Disk Quotas...

December 23, 2020

1 comment

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

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange
  • Windows 10
  • Windows 8
  • Windows 7
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2008 R2
  • PowerShell
  • VMWare
  • MS Office

Recent Posts

  • Preparing Windows for Adobe Flash End of Life on December 31, 2020

    January 22, 2021
  • Checking User Logon History in Active Directory Domain with PowerShell

    January 22, 2021
  • How to Disable/Remove Thumbs.db File on Network Folders in Windows?

    January 21, 2021
  • MS SQL Server 2019 Installation Guide: Basic Settings and Recommendations

    January 19, 2021
  • USB Device Passthrough (Redirect) to Hyper-V Virtual Machine

    January 15, 2021
  • Windows 10: No Internet Connection After Connecting to VPN Server

    January 13, 2021
  • Updating the PowerShell Version on Windows

    December 24, 2020
  • How to Enable and Configure User Disk Quotas in Windows?

    December 23, 2020
  • Restoring Deleted Active Directory Objects/Users

    December 21, 2020
  • Fix: Search Feature in Outlook is Not Working

    December 18, 2020

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Repair EFI/GPT Bootloader on Windows 10?
  • How to Run Program without Admin Privileges and to Bypass UAC Prompt?
  • Licensing Mode for Remote Desktop Session Host is not Configured
  • Configuring Port Forwarding on Windows
  • Updating List of Trusted Root Certificates in Windows 10/8.1/7
  • How to Upgrade Windows Server 2019/2016 Evaluation to Full Version?
  • Allow RDP Access to Domain Controller for Non-admin Users
Footer Logo

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


Back To Top