Monday, 30 March 2015

How to create host header Web Application in SharePoint 2010

When you create a web application in SharePoint 2010 you specify IIS web site name and a port number to which the web application will be running on, and to browse that web application you normally enter the server IP address and port number in the http url (e.g http://ServerIPAddress:portanumber) or you enter the machine name and port number. If you want to avoid entering IP Address or server machine name in the url and wanting to browse the web application by a domain host name e.g mywebapp.testdomain.com, there is an option called Host Address, while creating the SharePoint web application  you can specify the fully qualified host address which you will use for browsing the web application.
Below steps shows how you can specify the host address and configure it to route the request to your SharePoint web application.
Step1: First you need to decide the host name, let’s say your domain name is testdomain.com, and you want to create a web application with host address mywebapp.testdomain.com
Step2: Now you need to create a DNS entry on your AD server. Open the DNS from Start->Administrative Tools as shown in below screen shot

Step 3:  Explore your domain name testdomain.com and right click to create New Host (A or AAAA) entry.




 
Step 4:  Specify the new host name and IP address of your SharePoint WFE where your web application will be deployed

  
Step 5:  Once the DNS entry is done, you need to make Registry entry on your SharePoint WFE server. To make registry entry on the WFE server, just type regedit in Start->Run window
From the Registry Editor, explore HKEY_LOCAL_MACHIN -> System -> CurrentControlSet -> Control -> Lsa -> MSV1_0  as shown in below screen shot and edit the BackConnectionHostNames and specify fully qualified host name.

Once the registry entry is done, it is recommended to restart the server.
Step 6: Now you can create a web application in SharePoint 2010 from Central Administration and use the host header mywebapp.testdomain.com

Once the web application is created, you can create a root site collection. Now you can browse the web application by using the host header and specified port number (http://mywebapp.testdomain.com:port/)

Note: In your intranet if it still does'nt render the web application by browsing it by host adress, just make sure 1) you have entered the host address in your browser proxy 2) host address and IP address entry in host file on your local machine (Start->Run, type drivers and enter, click on etc folder you can see host file)

Authentication Error with SharePoint Application which uses Host Header on the Server firm

This is known issue with SharePoint 2007 or SharePoint 2010 on Windows Server 2008 platform and not specific to any sharepoint application.
Problem: Your windows credential doesn’t work if you try to log in to the web application (http://contosto.company.com) on the server itself although you can access the same site from outside, when you create a SharePoint web application with a host header (contosto.company.com) on SharePoint Server (Server Name: contosto) which is installed on Windows Server 2008. This problem is happening with the recent patches.
image
If you check the event viewer logs on “Security” category, you will see something like the one below under Audit Failure Keyword
image
The main reason for this issue is Windows includes a loopback check security feature that helps prevent reflection attacks on your computer. Therefore, authentication fails if the FQDN or the custom host header that you use does not match the local computer name as the system blocks the authentication procedure while resolving the host header given to the web application.
To resolve this issue, a modification must be done to the server's registry to specify the host name. To specify the host names that are mapped to the loopback address and that can connect to Web sites on your computer, follow these steps:
  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
  3. Right-click MSV1_0, point to New, and then click Multi-String Value.
  4. Type BackConnectionHostNames, and then press ENTER.
  5. Right-click BackConnectionHostNames, and then click Modify.
  6. In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.
  7. Exit Registry Editor, and then restart the computer.
image
The name placeholder is considered a host header. It is an alternative name for the computer on which Reporting Services is installed. You must add the NetBIOS and the Fully Qualified Domain Name (FQDN) for name to the BackConnectionHostNames list that is stored in the Windows registry.
For example, if name is a Windows computer name, such as contoso, the name can likely also be referenced in FQDN form as contoso.domain.com. You must add both representations to the list in BackConnectionHostNames.
So, The above registry modification must be done for all other SharePoint applications which are using Host Header.

Authentication Error with SharePoint Application which uses Host Header on the Server firm


















 
 

Reason: The main reason for this issue is Windows includes a loopback check security feature that helps prevent reflection attacks on your computer. Therefore, authentication fails if the FQDN or the custom host header that you use does not match the local computer name as the system blocks the authentication procedure while resolving the host header given to the web application.
To resolve this issue, a modification must be done to the server's registry to specify the host name. To specify the host names that are mapped to the loopback address and that can connect to Web sites on your computer, follow these steps:


Solution:
§  Click Start, click Run, type regedit, and then click OK.
§  In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
§  Right-click MSV1_0, point to New, and then click Multi-String Value
§  Type BackConnectionHostNames, and then press ENTER.
§  Right-click BackConnectionHostNames, and then click Modify
§  In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.
§  Exit Registry Editor, and then restart the computer





SharePoint 2013 Prerequisites fails with MSI Installer error code 1603 while installing AppFabric 1.1

When installing SharePoint 2013 prerequisites on Windows Server 2008 R2, the prerequisite installer fails with the following error
Appfabric installation failed because installer MSI returned with error code:1603
This is a generic MSI error message and does not give any indication about how to get the issue fixed. Uninstall or reinstalling only makes it worse.
The issue can be caused due to the following:
  1. The path to the PowerShell executable that is needed for the AppFabric installation is incorrect.
  2. In some scenarios, repeated uninstallation and re-installation does not fix the issue. This is because the installer does not remove the PSModulePath entry in Environment Variables during un-installation and the installation fails because the entry already exists.
  3. If you are trying to install all the prerequisites manually as the server does not have a connection to internet.
    Note
    : Appfabric installation and configuration has to be done by the prerequisite installer ONLY and not in a stand-alone manner.
You can implement any one of the two solutions listed below
  1. Solution 1
    Append the following path to PSModulePath entry in the environment variables - %SYSTEMROOT%\System32\WindowsPowerShell\v1.0
    • Go to My Computer, right-click Properties
    • On the System' page, click Advanced System Settings on the left-side pane.
    • If you receive a UAC prompt, click on Yes to launch the System Properties dialog box
    • From the Advanced tab, click Environment Variables
    • Within the System Variables section in the lower half, select PSModulePath and click on Edit (or double-click PSModulePath')
    • Append the following path to PSModulePath entry in the environment variables
    %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
    • Ensure that the PSModulePath entry looks like this:
      C:\Windows\system32\WindowsPowerShell\v1.0\Modules\;c:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules

  2. Solution 2
    • There are chances that other applications might be referencing the same variable and may fail if it is deleted. This is what we can do if solution 1 does not help.
    • Remove the PSModulePath entry from the 'Environment Variables' and re-run the installer. Once it completes successfully, ensure that the PSModulePath entry looks the same as mentioned in solution 1.
  3. Solution 3
You can download the list of prerequisites from Links to applicable software
Links to the individual prerequisites:

The steps listed below are for AppFabric for Windows Server only
Follow these steps for installing AppFabric for Windows Server correctly
  • Uninstall the Appfabric for Windows Server from Control Panel -> Programs and Features page
  • Download the individual requirements to a network location or a local folder
  • Install prerequisites for SharePoint 2013 manually
  • From the Start menu, open the Command Prompt window using the Run as administrator option.

    - Navigate to the root of the SharePoint 2013 installation media or folder location
    - Type the prerequisite program switch and corresponding argument for the program that you want to install, and then press ENTER.
    For example:

    If
    we have to install AppFabric for Windows Server from a local source, we can run the following command: PrerequisiteInstaller.exe /AppFabric:<location Of the Appfabric installation file>
    This will kick off the prerequisite installer wizard which will then use the installation file stored locally on the machine as specified in the command-line to install Windows Server AppFabric. We can also install more than one prerequisite by using different switches with the PrerequisiteInstaller.exe command to install multiple components and specifying the installation path in the command line window. For example:
    PrerequisiteInstaller.exe /AppFabric:<location Of the Appfabric installation file> /IDFX11:<Install Windows Identity Foundation v1.1 from file>
    This command will install Appfabric and Windows Identity Foundation

    For a complete list of prerequisite installer operations and command-line options, see Prerequisite installer operations and command-line options

  • The SharePoint 2013 prerequisite installer (prerequisiteinstaller.exe) installs the following software, if it has not already been installed on the server, in this order (provided you have downloaded the prerequisites locally):
    PrerequisiteInstaller.exe
    /SQLNCli:file - Install Microsoft SQL Server 2008 R2 SP1 Native Client from file
    /PowerShell:file - Install Windows Management Framework 3.0 from file
    /NETFX:file - Install Microsoft .NET Framework 4.5 from file
    /IDFX:file - Install Windows Identity Foundation (KB974405) from file
    /Sync:file - Install Microsoft Sync Framework Runtime v1.0 SP1 (x64) from file
    /AppFabric:<location Of the Appfabric installation file>
    /IDFX11:"<path>\Microsoft Identity Extensions.msi"
    /MSIPCClient:"<path>\msipc.msi"
    /WCFDataServices:"<path>\WcfDataServices.exe"
    /KB2671763:"<path>\AppFabric1.1-RTM-KB2671763-x64-ENU.exe

  • where "<file>" signifies the file location from where you want to install. If you do not specify the <file> option, the installer downloads the file from the Internet and installs it.
The prerequisite installer creates log files at %TEMP%\prerequisiteinstaller.<date>.<time>.log. You can check these log files for specific details about all changes the installer makes to the server.

Reference: http://blogs.technet.com/b/praveenh/archive/2013/02/22/sharepoint-2013-prerequisites-fails-with-msi-installer-error-code-1603-while-installing-appfabric-1-1.aspx
 

Error while enabling Windows feature : NetFx3, Error Code : -2146498298 , Please try enabling Windows feature : NetFx3 from Windows management tools and then run setup again.

How to install NetFx3 on Windows Server 2012 (required by SQL Server 2012) 

 

In this post, we will learn how to install the NetFx3 feature (.Net Framework 3.5) on Windows Server 2012 (R2). This feature is required by SQL Server 2012.

Scenario
Recently I have had the opportunity to setup a new Windows Server 2012 (R2) virtual machine in which I must install a new SQL Server 2012 instance. SQL Server 2012 Service Pack 1 installation wizard requires NetFx3 Windows feature enabled, if that feature is not enable, the SQL Server 2012 setup wizard will end with the error shown in the following picture.

Picture 1 – Error while enabling Windows feature: NetFx3

How to install NetFx3 on Windows Server 2012 (R2)
First, we have to open the Server Manager Tool of Windows Server 2012 (R2) and then we have to click on the Add Roles and Features item in the Manage menu as shown in the following picture.

Picture 2 – Add Roles and Features item in the Manage menu

If we have not already specified that we want to ignore the preliminary operations, it will show the Before you begin section of the Add Roles and Feature wizard as shown in the following picture.

Picture 3 – Before you begin section of the Add Roles and Features wizard

Click Next button, the wizard will shows the Installation Type section where we have to select the Role-based or feature-based installation option that it has used to configure this server by adding roles, role services and features. Picture number 4 shows the Installation Type section.

Picture 4 – Installation Type section of Add Roles and Features wizard

Click Next button, it will show the Server Selection section; in this section we have to select the Server on which to install NetFx3 feature, so click Select a server from the server pool and over the grid, select the server as shown in the following picture.

Picture 5 – Server Selection section of the Add Roles and Features wizard

Click Next button again, the wizard will shows the Server Roles section as you can see in the following picture.

Picture 6 – Server Roles section of Add Roles and Feature wizard

No selections are required in this section because we have to add a feature (NetFx3 is a Windows feature) and not a Server Roles. Click Next button to go to the Features section that shows all the Windows features that you can install on the selected server. As you can see, .Net Framework 3.5 Features has not installed yet; click in the related check box as shown the following picture.

Picture 7 – Features section of the Add Roles and Feature wizard

Click Next button, the wizard will shows the Confirmation section.

Picture 8 – Confirmation section of the Add Roles and Features wizard

As you can see, at the top of the window shown in the picture number 8 there is a warning message. It informs you that for one or more installation selections are missing source files on the destination server, so we have to specify an alternative source path. Click the Specify an alternative source patch link, the wizard will shows the window in the following picture.

Picture 9 – Specify an alternative source path for NetFx3 source files

The required source files for the .Net Framework 3.5 are in Windows Server 2012 (R2) DVD (or in the related ISO file); in this virtual machine, the DVD device is associated to the letter "F". Therefore, you can specify this alternative path "F:\Sources\SxS". Click OK button to return in the previous window (picture 8), so click Install button to start the installation process. The Results section will show the installation status, at the end the status will be Completed successfully as shown in the following picture.

Picture 10 – Result section of Add Roles and Feature wizard

The NetFx3 (.Net Framework 3.5) feature has been installed in your system. Now we can retry to install SQL Server 2012 Service Pack 1, the error shown in the picture 1 has been fixed.
Summary
By default, on Windows Server 2012 (R2) the NetFx3 (.Net Framework 3.5) feature is not installed because is already installed the .Net Framework 4.5; however some applications may require the NetFx3 feature and in this post we have learned how to install it.
This test has been done in a VMware virtual machine. Thanks to VMware Gurus Program because it donated to MVPs a license of VMware products.

Sharepoint 2013 workflow + The server was unable to process the request due to an internal error

RequestorId: 321d7a5c-ca52-907e-0000-000000000000. Details: RequestorId: 321d7a5c-ca52-907e-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 401 {"error_description":"The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs."} {"x-ms-diagnostics":["3001000;reason=\"There has been an error authenticating the request.\";category=\"invalid_client\""],"SPRequestGuid":["321d7a5c-ca52-907e-aab4-69867fb6c2f8"],"request-id":["321d7a5c-ca52-907e-aab4-69867fb6c2f8"],"X-FRAME-
":["SAMEORIGIN"],"SPRequestDuration":["64"],"SPIisLatency":["3"],"Cache-Control":["private"],"WWW-Authenticate":["Bearer realm=\"3eafb22a-93a3-48a8-9c32-16829fce2722\",client_id=\"00000003-0000-0ff1-ce00-000000000000\",trusted_issuers=\"
00000005-0000-0000-c000-000000000000@*,00000003-0000-0ff1-ce00-000000000000@3eafb22a-93a3-48a8-9c32-16829fce2722\"","NTLM"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"MicrosoftSharePointTeamServices":["15.0.0.4481"],"Date":["Mon, 28 Oct 2013 10:49:09 GMT"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem
System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)



I found this error when I attached a designer List workflow and tried to start the workflow

Solution: Your User Profile Sync Service Should be running .If not add the user to the "Manage User " of User Profile server ,this is the user who triggers the workflow


Basic principle behind this is every user triggering the WF should have a profile of him in User Profile Application Service.

Uninstalling/Removing SharePoint 2013 Workflow Manager Farm

These are the steps you would need to take to un-install your Workflow manager 1.0:
For each node in your workflow farm:
  1. Leave the workflow farm (Remove the node from the farm using “Leave Workflow Manager Farm” option)
UninstallingWFM_0


UninstallingWFM_00
UninstallingWFM_1
     2.      Uninstall the following programs in the program list in the Control Panel window, under Programs select Uninstall a Program.
  • Service Bus 1.0
  • Windows Fabric
  • Workflow Manager 1.0
  • Workflow Manager 1.0 Client
UninstallingWFM_2
Once you are sure all nodes have left the workflow farm, you can delete below databases from you SharePoint SQL Server: (Backing them up beforehand might be a wise choice!)
  • SBMessageContainer01
  • SbGatewayDatabase
  • SBManagementDB
  • WFInstanceManagementDB
  • WFManagementDB
  • WFResourceManagementDB
UninstallingWFM_3

Install and Download SharePoint 2013 prerequisites offline (manually)

This article applies in a situation when you don’t have internet access in your SharePoint server , I have placed all the direct download links for the installers you might need.
This article assumes you are having a new fresh installation of windows server 2008 R2 SP1
If you tried to run the installer , The following should be installed (but you cant install them directly from here since you don’t have internet)

clip_image002


in this case  you can download and install SharePoint 2013 Prerequisites offline and run them manually as below:
I have placed what needs to be installed on a clean Window server R2 SP1 , you should not need more than this:


Prerequisite Direct Link
Microsoft .NET Framework 4.5
(Full Stand alone package)
http://go.microsoft.com/fwlink/?LinkId=225702
Or
Download tFx45_Full_x86_x64.exe from stand alone section from
http://msdn.microsoft.com/en-us/library/5a4x27ek.aspx
Windows Management Framework 3.0
http://www.microsoft.com/en-us/download/details.aspx?id=34595
Microsoft SQL Server 2008 R2 SP1 Native Client
Download 1033\x64\sqlncli.msi from
http://www.microsoft.com/en-us/download/details.aspx?id=26728
Windows Identity Foundation (KB974405)
http://go.microsoft.com/fwlink/p/?LinkID=226830
Windows Identity Extensions
http://go.microsoft.com/fwlink/?LinkID=252368
Microsoft Sync Framework Runtime v1.0 SP1 (x64)
http://go.microsoft.com/fwlink/p/?LinkID=224449
Windows Server AppFabric
http://go.microsoft.com/fwlink/?LinkId=235496
(Note: don’t install WindowsServerAppFabricSetup_x64_6.1 this is not the correct version that
SharePoint installer seeks)

Download it but don’t install it by yourself since it needs configuration, hence install all other
prerequisites in this article (except this one) then let the prerequisite installer to install AppFabric
and configure it manually for you by running the following command from command prompt:
prerequisiteInstaller.exe /appfabric:[Full AppFabric Installer path]
clip_image004
D: is the CD drive where SharePoint installer is placed

Microsoft Information Protection and Control Client
http://go.microsoft.com/fwlink/p/?LinkID=219568
Microsoft WCF Data Services 5.0
http://www.microsoft.com/en-us/download/details.aspx?id=29306
Cumulative Update Package 1 for Microsoft AppFabric 1.1 for Windows Server (KB2671763
Download AppFabric1.1-RTM-KB2671763-x64-ENU.exe from
http://www.microsoft.com/en-us/download/details.aspx?id=29241
You need to Install AppFabric from above first then run this update,
dont run this update if appFabric above is not installed yet