theme-sticky-logo-alt

The tool was unable to install Web Server (IIS) Role – SharePoint 2016 on Windows Server 2016

14 Comments

While I was doing a SharePoint 2016 install at a customer, I got hit by the The tool was unable to install Web Server (IIS) Role error when trying to install the SharePoint 2016 prerequisites on a Windows Server 2016.

The tool was unable to install Web Server (IIS) Role

I know back in SharePoint 2013 this happened a lot, and there was a support article for it called The Products Preparation Tool in SharePoint Server 2013 may not progress past “Configuring Application Server Role, Web Server (IIS) Role”. This article gave us the following PowerShell cmdlets to run, that would basically install some of the features and roles that SharePoint Needs.

Add-WindowsFeature NET-WCF-HTTP-Activation45,NET-WCF-TCP-Activation45,NET-WCF-Pipe-Activation45
Add-WindowsFeature Net-Framework-Features,Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Security,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Digest-Auth,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Application-Server,AS-Web-Support,AS-TCP-Port-Sharing,AS-WAS-Support, AS-HTTP-Activation,AS-TCP-Activation,AS-Named-Pipes,AS-Net-Framework,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Web-Lgcy-Scripting,Windows-Identity-Foundation,Server-Media-Foundation,Xps-Viewer

When trying to run this on Windows Server 2016, we get this error: Add-WindowsFeature : ArgumentNotValid: The role, role service, or feature name is not valid: ‘Application-Server,AS-Web-Support,AS-TCP-Port-Sharing,AS-WAS-Support,AS-HTTP-Activation,AS-TCP-Activation,AS-Named-Pipes,AS-Net-Framework’. The name was not found.

The tool was unable to install Web Server (IIS) Role

That is because the Application-Server role has actually been deprecated from Windows Server 2016. Some of its features have been added to the WAS role. The correct cmdlet you need to run for a Windows Server 2016 installation is :

Import-Module ServerManager
Add-WindowsFeature Net-Framework-Features,Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Security,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Digest-Auth,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Web-Lgcy-Scripting,Windows-Identity-Foundation,Server-Media-Foundation,Xps-Viewer –Source D:\sources\sxs

And make sure to replace the D:\sources\sxs to the actual path of your sources file. The sources file is on your Windows Server 2016 installation media, and you need to specify it and have it mounted on your computer (or copied somewhere) for the prerequisite install to work properly! Everything should work properly afterwards to run the prerequisite installer! In theory, a reboot is not needed, but I always prefer to do one after activating that many features just in case!

Previous Post
Datapolis Workflow 365 is now available in the Office 365 Store!
Next Post
Lanteria HR referral program – will you participate?

14 Comments

  • February 18, 2018 at 2:07 am

    Thanks Vlad. The article helped me a lot.

    Reply
  • March 30, 2018 at 6:35 am
    Mattias Vannergård

    Thanks!
    Exactly the same was needed for SharePoint 2013 on Windows Server 2016.

    Reply
  • March 30, 2018 at 10:54 pm
    rootleet

    installation progress stuck at 24% now, but i just hope it works. Thanks tho

    Reply
  • April 11, 2018 at 10:02 am
    stuck

    Did yours ever finish? Mine seems to be stuck at 24% too. ~25 minutes

    Reply
  • November 1, 2018 at 4:40 pm
    Billy

    Thanks, This works on SharePoint 2019 too.

    Reply
  • December 5, 2018 at 11:30 am
    Nilesh

    Yes. It worked on SharePoint 2019 too.

    Reply
  • December 24, 2018 at 5:54 pm
    John

    Worked like a charm! Thanks

    Reply
  • January 8, 2019 at 8:38 am
    John

    Great info here. Thanks for posting.

    Reply
  • January 25, 2019 at 4:34 pm
    Bhavesh

    Thank you. Worked for 2019 as well.

    Reply
  • February 8, 2019 at 2:24 pm

    Your solution worked perfectly for SharePoint 2019 Prerequisite Installer on Windows Server 2019. Thanks for taking the time to post it.

    Reply
  • March 13, 2019 at 4:57 am
    Hanieh HabibBeygi

    Thanks. It’s done.

    Reply
  • August 6, 2019 at 6:17 am
    Mirko Federlechner

    Merci !!! worked !

    Reply
  • September 19, 2019 at 3:46 pm
    Persistent guy

    It was stuck for a while on 24% but continued

    Reply
  • May 8, 2020 at 1:24 am
    Jeff

    Tried to run this in WS2016 and somehow stuck at 24%. Run as local administrator.

    Reply

Leave a Reply

15 49.0138 8.38624 1 0 4000 1 https://vladtalkstech.com 300 1