Share via


SharePoint 2013 Troubleshooting: Configuring Application Server and Web Server (IIS) Role when Installing on Windows Server 2012

Issue

This error appeared when I'm configuring the SharePoint 2013  farm Pre Requisites using the installer.

Use AutoSPInstaller and it will end with below error

2019-01-22 09:48:02 - Return code (2)
2019-01-22 09:48:02 - It is recommended that you keep your Windows operating system up to date on http://windowsupdate.microsoft.com

https://lh3.googleusercontent.com/EiS2f66rntjbE6FLAbveXG7w8SKHK2AEVo8gL3myEVRTvDD85yA7BBEGOT4sVKZQOzAnyCmp57zi3GIsFsEFJAYvg1b7q2X1-9q1T_A4E0Vz8jsZ9GBNZP2NTIW1_IZUN8LPrAui-xB0SknZdiuUO3Ir47F6B51qezWfPtTelH4lPsK84G9HUj7MKftKXPJLqfv8GApAuI4lm7Eb2jlCVi1KPsRIuKpyyqEjOpTvyWGErCfCeEN5ItPYSEzWwHq_6JQyGzwvkUKiZECGHbrnGL7JcF-57Nv6szFaPtmC27JuTtDx4pvlm-ot4_57DIrhwPcTRXutjsDaLoGNEFXCJol_1ffRnD1_4taZl0AruIArpoo-okPzkGX5bFWAItnlr_fC1Nz5So8y0f8xQjWfWoS3XmIZEc-T5b--JMJnBuokxcy8smnpFbI0a7Cz15f-ImE-sJJh9aKCPI3b1FCNbapq4Xw8IwrZhZ9OpSpupHiuOVBMebZnwwxPYFb-XOCrOXtfedKMC4IR9MzgqQ02_QFGHIRY0cAGqwcPF3R0QJbquo6lmdk8HCiJH5SUmeC3vvz157pFJEafdpGR-w7Za8uvdH4GFgUmeX5wCIRZs_jBerQmz4fyruqLPsF8mBQf9CDlW2Hbmtad_SeFIxCALcG4BMnehj7YtGeouJ8RFUFLJLxRSA-OS-jqKSn7vhcZHOTULX7vWuRGNVE69uw=w844-h440-no

When you try SharePoint prerequisites installer (prerequisiteinstaller.exe) it ends with below error.

Application Server Role, Web Server (IIS) Role: configuration error

https://lh3.googleusercontent.com/xQXM6P-xQVMz8pDbBqSfI9Gvk6aG1mp0ol96j_ln_kQGuovbMcRXM57etr3aJp0G144E8COML9IZ2AQeCHZI7MQD0sDjjvmpsv89Sinfkw1Qwa75MGAdl8-K6xszLxc_AFv9ANrHbW0GED27lmjIRAdTWgHxS47KUubYlvVLGvDrh7-a85PtBr74t8yjTwkCDDacAbDa48LZpzrlY3MjnZU_LzCmsi8TEGeIvhhHM6gWM_fWy7ipaFSjxJLGKu7cPtJj3tTkKQwGQJfdYRAcUGjWMuPcIpnBraaeg1S798q7W7hCg8sDP0fPjGsKPWwTn28v2tCHxt2Vaj_tvRHN9HcticiKZdIT0H2C-CxZH6uB_GAFzLl8YXY5tvQSwjEZh4O1Mg9iILbBXNiE2nfbCrIfj2cRjVqW78AGgcekIyAqMv5Avfvgz_FRZfvYNvKUGJvga2M55aTyZmSthxk3Gsr_qT9UbC9FWKmisoz2ejzEDPuMW_EIeR45Y1wIkB8A946fRhe4x5jJMEpeveXpoxL_P6PJ33M4Em5OdLF0EVm7g0EKTp9a6sFX2ifuO776VhHDeOByQQAha6zn_2LOnUqfXvRv7p-xAyWEmATSrE2njyaAsMvG1vsu1MQ_bHX9jE36MxsgVRr9PksDRo9PJ9QUUraK3vzKD5dweGR34jjg2ZqiedVKmk-W6V5NDfTNhtb3tgxnimc-nQfd0Zk=w692-h521-no

How to solve this issue

There are numerous reasons where you will encounter this issue.

Resolution 1

Try to execute the installer using Admin Account and you should be a local admin on your server.

https://lh3.googleusercontent.com/1S1g5gyhcE0PBI5eSfUiyGv2UirYgqKGJKQ66Fs-_oIZBBSUKmyb06Ios8Kfw4wXjFQW5mNLklzsmkpDYCBVqOaO1yOerndge0HNaAwIIIilIpxIF80S_r9AMShvbOE2fSwRaggDJHZ1YQK9C9jDgIAmnqkAm0LqmWeUKxiUVbtK-vUIDYiVOYM1N_aHlv1KyPQRl76un3mnTdDK_RTrelaQblZ5f6fXp-dPDkyyImqkUfLpKrrP8VRHsmV9wuSG6cyHEuKNkugT1kRC-e_71F5O6GLVmWxHQ8ECIP8XxvEi6v3t1IXhjunBpcxXPwCmzRpiaaIzs9QasgqEZPStWB5rzsXZIy-4dCIrlHAZUDYJlRYAFuFHJLSohFS8P40Kyw5K4IAIYkBSQ_PsFMXsuLH4iSyg9SVidUGvqnFXfMGf7rmSCqJriewWPa5hwuHtUkO4d3n78krzWgi_FP_DFo2HcHBCnb1nmG5vSAvWJ23PuQ-f20cY9Joj5P34SyL7Jxk_KALQ_1c8m9RwxFiSnalZdEg9TNZmXiicBH9Pf36Hms1KKvgi1qUE7oKk4Gt3bbavZw_Yk4ybBGlEGiKtCskiGJBHN5l78PwdNwcKzxEqWh4sHX8PX4-Jvx6e29ERRXBsKHy03mhunJWAsHTEC6m3Z-PMpkxIX7cbZPI-O98sIzBHCb4DDaxXEVXbtwlGOA0Ty0RNIdGWCa4dh7g=w339-h123-no

Resolution 2

Install The .Net components manually using the server manager.

https://lh3.googleusercontent.com/jS-N4dzsCixsM1RowxRDeI4OWe_JfapHm40G3LAXQCldVCVCYhUb7tz9btHsH_DD7y_SQPFdqdaGfHPhRkhWibrbmNjiGUZP4nklwXQWHvRW2DLApg_BSrdBXmG2r9hOj9nIUu3yCT86HmNt8JbRohWIorz9wWvA4dGI08h07AmEb8FogImDuF2hPrXEw9WiUmZtqvWgmVvUT9dlS8h7W8RYtYg7_EuQLI3Gvr3d-f1qwcTTPSGB10xp-BfeYWMpRmKs2Di8NoXfhhl6Cds8Hax3QcYeoknAgZFN5rCVarrZueH9UXJZqJcp87XQraRr2glb0MSKOLBLZTmCKiFS8rxcMvXAu52VWJhmPb8GUYvbe47o4PxQkVWG78qEI326dbe-rr_MY-PBHaNrCzEvejZpD5z-fiGY4bOsHBGC7w3rGyZyeBwjDj57y3LopmZddwfmCeWDp1hBjoWHhxQbcqTlZbsx9S_pQnlid-aH1hd0AIg50jP6jOvT8Azelu8aKhvswqLrsCbYLfqPVHD1C-VEJ0EdG89a6Xxqk_jpGUxJoEfWWgB5hNGHigqF0d_xVqK5aDhF3FWjB6fg-r9Du9MtDFreComj8SlZzZBHCMXEeSr_KiqiSAwV-cf-U-nuPPeuCSiEPrLrb-7ETdMNTd5CnmkzjzzOskdj35UaiFGwHXngJnMOczEGAH3uXWWgMJvvAssNVah9wAerfgQ=w343-h197-no

Add Roles and Features and then Skip until you  reach Features,

https://lh3.googleusercontent.com/NTybgh0lriwgyXwf9z1AHfLDKExLu3cnLQIgKd49bLMTLSfeYwGXhYaAzfdTz54zHBCUpZy5gjR9geyTXptoqroj0xQETd9237igx3jMt2Ja0mZ0lzAdjUXp2q-PugeZdidYjDB7gX0RcZWQO-7kgxWEccHZh96901GGnw6_g_xgwqGqLj5KTBERPZDIOOw10fxr-k1-4YqdV40E5alo_wdhFmh4OiqSswdV1vsX8gu6fjrpoJKLSy5hZ2_XAr6BmRdonMzBXZN_fmItBJIHn5-Fsbde-YX5XjU7smJoS1JijYJ1xem4y8DXe3UclGweGjiQ7bEoEZrE-bUeOfLqiA6jDGxJVOBFQb7wT9ExZVMk-rs8QqQR1sTSXFvXP2YNlZRJFeEPPLZ8deuIQQkWcdv7_GOwlMldNOS1ovv78Pu9x15q05q5V8kW0DzKzytTqw_iy54m0hcCqlTBgUsWnQVaj-AwGzQpTkpP6VltLHRc6FOGvSf-1F51ZaBBKXvtXT9Ll5RSphifbqYwQy5XQtTUgXz5O3bmCyvSoFful9Btmu120uD6sqlXsG5IMjqjDLVLICl3ug826VPsTwdDErMpuR99Dk5sEZmKtt_ZzFrAKrTaUCKln2d4RtT1IcyR6pbiA3YVWGtQUTfRSyRnnktnAA2D_nzT26Rkw4QUHxG3LSxAl4Rr5xL4KbUFxazW0RnnrRI6OF4Ypsu000M=w549-h344-no

And install .NET 3.5 and 4.5 as described. You might need to insert Source Path for installing 3.5 Framework. 

Resolution 3

Sometimes installer could not execute the shell commands due to various issues, thus

  • Mount the Windows Server Installer CD in a Drive (assume E:\
  • Run following code in the PowerShell

https://lh3.googleusercontent.com/2eydbPja93BCHThfYY259ciUshLRvRxPjH8UCYXr0RldhJ5MI9hHFipcc8uVnL-kRF3Sd3iCAiqjRBh34rPXusdALmkRwuLRvV8VTloo3pq417ge8j9aoOiIOxRF2Un1CGdug9f9lrZaFzw0xkXh69IjKUAWK2I5ZARX6pn6zw41gSR4bGpvFetOgw6n_y-aEVOxAbDeZE3RBjjPLXwC4Qw749yDEEq33rP1o-jJFCdMRhtSf55zEyWS2ugJRQSD95nyRwPJNpbQU0aJW_cafzsc3ccdDZfZxroiTieGsqEixUco9W85ruSNS96H58O4j9AZRQRC73besv49BYSwXH2FP2PitVb00Szw46UGUwnX3Y4ZRG05y_WfBvsv3kDIdfFpGhXUJnld2t9VZbsETwz6ZSm7Mq4Nck4yf0DWiPm7CrYLRaZF7UtA1Q26wWjEy3ISBI6kcnspbq4xryJWDrs3uCMx_LuYXELCL4OCDB4U-DuIfQElmEtQPPqLgheC2oeOVz6IDz2Op3SqG8SsZRrHgwczT6EjZMrypPeyMpNi-g0_0qVCb9UUZkdA7SCUZOhnWbFhIxH-pDCWHl-ORz2fCFlnPGi_pURkK3IlDbg1wUA9QNLxJ8wOXTpPMqvStr9yq401WrTLxvVQLmlRQHS1nfHETsjwo9GN2xLBADYKX9YmjEXxc7_yjiQyy073lkMD4i7cEZxtYVJwT_E=w364-h242-no

  • Make sure you are connected

Execute the following code in the PowerShell.

Add-WindowsFeature Web-Server,Windows-Identity-Foundation,NET-Framework-45-ASPNET,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Web-Lgcy-Mgmt-Console,Web-Lgcy-Scripting,Web-Mgmt-Tools,Web-WMI,Web-Common-HTTP,NET-HTTP-Activation,NET-Non-HTTP-Activ,NET-WCF-HTTP-Activation45 -Source 'E:\sources\sxs'

Resolution 4

The tool tries to execute the Application which resides in 

%SystemRoot%\system32\ServerManagerCSD.exe

But current Windows server installation has the server Manager in a different name

%SystemRoot%\system32\ServerManager.exe

So Just copy the ServerManager.exe  and paste it and renamed to ServerManagerCMD.exe