Unable to install Application Server Role, Web Server (IIS) Role SharePoint 2016

When installing on new win 2016 VM i got this error: Unable to install Application Server Role, Web Server (IIS) Role. Most solutions install features using Win Server ISO installation and Powershell. But you can enable to download features/components from windows update.

When we run the SharePoint 2016 pre-requisites installer in order to prepare our machine to install SharePoint 2016 product installation on Windows Server 2016, the installer fails due to the error shown in the screen below:

“The tool was unable to install Application Server Role, Web Server (IIS) Role”

 

The error occurred due to the reason that your operating system Windows Server 2016 do not allow applications to connect to the internet straight away to download files necessary for installation.

In order to fix this error, some steps need to be taken as described below:

  1. Open an MMC console.
  2. Add the Group Policy Object snap-in.
  3. The following screen will open.
  4. In Local Computer Policy go to Computer Configuration –> Administrative Templates and select “System”.
  5. Scroll down the list in the System settings and find “Specify settings for optional component installation and component repair”. Double-click the settings, a screen as displayed below will appear.
  6. Select Enabled in the top left corner and select “Contact Windows Update directly to download repair content instead of Windows Server Update Services (WSUS)”.
  7. Click OK and close the MMC console.
  8. Run the pre-requisite installer again and this time it will not give errors on a server role installation.

note: also turn off internet explorer enhanced security configuration for admins…