Thursday, 24 March 2016

SharePoint 2013 FBA (Form Base Authentication) Configuration

SharePoint 2013 Configured Form Based Authentication using SQLMemberShipProvider.
You need to configure SQLMemebershipProvider as Users Database and then you need to do some changes in Sharepoint Central administration web.config, Your Webapplicaiton and Security Token Service.

1.     Configured SQL MembeShipProvider.

  1. Login to SQLserver.
  2. Go to following path  ->  C:\Windows\Microsoft.NET\Framework64\v4.0.30319
  3. Find the aspnet_regsql.exe, run that exe to configure membership Database.






Verify the Permissions

Open IIS on Sharepoint 2013 and open Pool (Security Token Service), see the Pool account user name . 
that user Must have full access to the database, Please follow the permission settings from below screen.
to Add new user right -> click on Users for that particular Database for Existing user select and given permissions.




2.     SharePoint 2013 Central Administration WEB.Config Changes.

  •          Open IIS   à
  •          Right click on Central Administration web application -à
  •          Click  on  Explore
  •          Very Important thing, you must have to backup Web.config
  •          Right Click and open the web.config
  •           Find the membership Section.

And replace with below lines.
<membership  defaultProvider="FBAMemberShipProvider">
      <providers>
            <add name="FBAMemberShipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="AltranExtranet" enablePasswordReset="true" enablePasswordRetrieval="false" passwordFormat="Hashed" requiresQuestionAndAnswer="false"
       requiresUniqueEmail="true" applicationName="/" />
      </providers>
    </membership>
Fine the Rolemanager
<roleManager defaultProvider="AspNetWindowsTokenRoleProvider" enabled="true" cacheRolesInCookie="false">
      <providers>
             <add name="FBARoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral,
        PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="FBAConStr" applicationName="/" />
      </providers>
    </roleManager>

Go at the end of Web.config and add connection string

<connectionStrings>

       <add name=" FBAConStr " connectionString="Data Source=SQL2012;Initial Catalog=FBAUSERSDB;Integrated Security=SSPI" />

</connectionStrings>


Find PeoplePickerWildCards and add your membership provider as key.

<add key=" FBAMemberShipProvider" value="%" />

3.     Web application WEB.Config Changes

·         Your web application must be Enable Forms Based Authentication (FBA)

·         Open IIS   à
·         Right click on Central Administration web application -à
·         Click  on  Explore
·         Very Important thing, you must have to backup Web.config
·         Right Click and open the web.config
·         Open Membership Section and add New MembershipProvider, web application have one exiting and default membership Provider

<add name="FBAMemberShipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="AltranExtranet" enablePasswordReset="true" enablePasswordRetrieval="false" passwordFormat="Hashed" requiresQuestionAndAnswer="false"
       requiresUniqueEmail="true" applicationName="/" />

Fine the Rolemanager
<roleManager defaultProvider="AspNetWindowsTokenRoleProvider" enabled="true" cacheRolesInCookie="false">
      <providers>
             <add name="FBARoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral,
        PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="FBAConStr" applicationName="/" />
      </providers>
    </roleManager>

Go at the end of Web.config and add connection string

<connectionStrings>

       <add name=" FBAConStr " connectionString="Data Source=SQL2012;Initial Catalog=FBAUSERSDB;Integrated Security=SSPI" />

</connectionStrings>

Find PeoplePickerWildCards and add your membership provider as key.

<add key=" FBAMemberShipProvider" value="%" />

4.     Security Token Service WEB.Config Changes

  •          Open IIS   à
  •          Right click on Central Administration web application -à
  •          Click  on  Explore
  •         Very Important thing, you must have to backup Web.config
  •         Right Click and open the web.config
  •         Find the membership Section.


<membership  defaultProvider="FBAMemberShipProvider">
      <providers>
            <add name="FBAMemberShipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="AltranExtranet" enablePasswordReset="true" enablePasswordRetrieval="false" passwordFormat="Hashed" requiresQuestionAndAnswer="false"
       requiresUniqueEmail="true" applicationName="/" />
      </providers>
    </membership>

Fine the Rolemanager

<roleManager defaultProvider="AspNetWindowsTokenRoleProvider" enabled="true" cacheRolesInCookie="false">
      <providers>
             <add name="FBARoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral,
        PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="FBAConStr" applicationName="/" />
      </providers>
    </roleManager>

Go at the end of Web.config and add connection string


<connectionStrings>
       <add name=" FBAConStr " connectionString="Data Source=SQL2012;Initial Catalog=FBAUSERSDB;Integrated Security=SSPI" /> 
</connectionStrings>


That’s IT ..

How to do testing.

  1.  You can down FBA pack for SharePoint 2013 at CodePlex  Download FBA Pack, follow the instruction given there and create user and test the logins 
  2. Create web application is Visual studio and open web.config.

 a.       Open web.config add Role in Section.


<add name="FBARoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral,
        PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="FBAConStr" applicationName="/" />

b.      Add membership provider and membershipsection.


<add name="FBAMemberShipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="AltranExtranet" enablePasswordReset="true" enablePasswordRetrieval="false" passwordFormat="Hashed" requiresQuestionAndAnswer="false"
       requiresUniqueEmail="true" applicationName="/" />

c.       Add connection string


<connectionStrings>
        <add name=" FBAConStr " connectionString="Data Source=SQL2012;Initial Catalog=FBAUSERSDB;Integrated Security=SSPI" />
 </connectionStrings>

Create a page and add Createuser Wizard
Open the particular page in browser and create User.



Monday, 30 November 2015

SharePoint 2010/2013 Automatic redirect from http to https


IIS 7.0+ Microsoft URL Rewrite Module is not available by default, you must need to download and install on all SharePoint front end servers

in this example i am using url.

http://portal.eteam.local
https://portal.etam.local.


Microsoft URL Rewrite Module 

SharePoint Settings :

SharePoint Web application alternative access mapping must be configured properly for HTTP and HTTPS.
  1. open Central administration , 
  2. Click on application management 
  3. click on alternative Access mapping 
  4. select particular application
  5. please verify all the url for the web application

Monday, 10 August 2015

Install SharePoint 2013 with Service Pack 1 On Windows Server 2008 r2 - Offline

Install SharePoint 2013 with Service Pack 1 On Windows Server 2008 r2

·        Install windows components
Import-Module ServerManager

Add-WindowsFeature NET-WCF-HTTP-Activation45,NET-WCF-TCP-Activation45,NET-WCF-Pipe-Activation45 -Source C:\PreReq\

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 -Source C:\PreReq\


·         Required Restart

·         Download the Components
The list of files to download are as follows:


·         Install other pre-requisite   Contents
$SPPath = "E:\InitialDirectry"

Start-Process "$SPPath \PrerequisiteInstaller.exe"
–ArgumentList "/SQLNCli:$SPPath \PrerequisiteInstallerFiles\sqlncli.msi
/IDFX:$SPPath \PrerequisiteInstallerFiles\Windows6.1-KB974405-x64.msu
/IDFX11:$SPPath \PrerequisiteInstallerFiles\MicrosoftIdentityExtensions-64.msi
/Sync:$SPPath \PrerequisiteInstallerFiles\Synchronization.msi
/AppFabric:$SPPath \PrerequisiteInstallerFiles\ WindowsServerAppFabricSetup_x64.exe /KB2671763:$SPPath \ PrerequisiteInstallerFiles\AppFabric1.1-RTM-KB2671763-x64-ENU.exe
/MSIPCClient:$SPPath \PrerequisiteInstallerFiles\setup_msipc_x64.msi
/WCFDataServices:$SPPath \PrerequisiteInstallerFiles\WcfDataServices.exe
/WCFDataServices56:$SPPath \PrerequisiteInstallerFiles\WcfDataServices56.exe"


Tuesday, 14 October 2014

SharePoint 2013: The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered


When I am trying to open sharePoint 2013 Powershell

I am getting below error



“The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered”

Add the current user as powershell admin

Close the Power shell and open it again , now you can access it with out any error

WH

SharePoint 2013 Installation Error AppFabric, AppFabric installation failed because installer MSI returned with error code : 1603

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

  • Right Click “My Computer”
  • Click “Properties”
  • Go to “Advance” Tab
  • Click at “Environmental Variables”
  • Look in to System Variables.
  • Find “PSModulePath” 
  • Click “Edit”
And Verify the Entry should look like below

C:\Windows\system32\WindowsPowerShell\v1.0\Modules\;c:\Program Files\AppFabric 1.1 
if you have different value then just just paste the above value.



Install AppFabric using below command.

Open Powershell and go to the AppFabric Path and Run the Command

\WindowsServerAppFabricSetup_x64 / i CacheClient, CachingService, CacheAdmin / gac

after executing the command , wait for few mintues and open the control pannel to see the installed programs

Friday, 26 September 2014

Network Load Balancing Using Windows Server 2012 For SharePoint 2013


Consider the Example That i have 2 Front-End server and One DNS record for Load Balance


Server Name
Role
IP
SP2013-FE01
Front end 1
192.168.137.15
SP2013-FE02
Front end 2
192.168.137.16
SPS2013
Load Balancer Name
192.168.137.30


SP2013-FE01 Sever

Step 1: Open Server Manager



Step 2: Click Manage on Right Top and Select “Add Role and Features”




Step 3: Leave every thing Default and Click Next


Step 4: "Select Installation Type"Leave Default and Press Next



Step 5:Selecting Destination server “Leave Default and Press Next



Step 6: “Selecting Role “Leave Default and Press Next



Step 7: “Selecting Feature “Select Network Load Balancing After checking the Check box it will prompt for Extra Features.




Step 8: Select Extra Feature Required for Network Load Balancing and Press Add Features and will return to main features screen, Press Install



Installation Process will start, Wait for Completion of installation



SP2013-FE02 Server

Open The Second Front server and Repeat the Step 1 to step 8.



Configuration of Network Load balance.

Open the Server First Server SP2013-FE01

Step 1: Open Server Manager and Click Tools and Select Network Load Balancing manager.



Step 2:   From Menu select Cluster and Sub Menu New.


Step 3: Enter the first Host Name, in current scenario I am using SP2013-FE01 and Press Connect
After connecting successfully it will add in interfaces And Press Next





Step 4: New Cluster -- > Host parameters  make sure for first node Priority  is select  1 from Drop down and Default state is to be selected as started .

Step 5: Define Cluster IP -> Press Add Button to Add cluster IP.


Step 6: Enter IP for Cluster in My Case I am using 192.168.137.30 and Subnet is 255.255.255.0 and Press OK

Step 7: Select the Cluster from Drop Down, (automatically selected if not selected then select manually) Enter the Full Internet name and From Cluster Operation Mode Select Multicast and press Next

Step 8: Port Rules it will select from 0 to 65535 if you want to edit it, otherwise leave as default and Press Finish.
Now you can see you Cluster , One node is already added, 

Add Second Node to the NLB Cluster

Right Click on Cluster  -"Add Host to the Cluster"


Enter Host IP and Press Connect after Press Connect it will added into interfaces.



Setting the host parameters, For This Node select priority 2 and state as "started"





Press Next and it will prompt for Ports setting , If you want to change can edit other wise leave it default.

Verify the nodes.



Wednesday, 24 September 2014

Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version

Source Server:
Running on SharePoint 2010 with SP1 (Installed SP1 manually)
Version Information:



Target Server:
Running on SharePoint 2010 With SP1 (Newly configure using SharePoint 2010 With SP1 Media)
Version information:




But I was trying to restore using Power Shell I am getting the Error for version is not same.
Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version 14.0.0....   Or later

Versions are same, that’s why I was not sure what the difference is,

I just verify the Installed Update I found at Source and Target server are different in the terms of SharePoint Updates.


  1. Download required Updates
  2. Installed on Target server
  3. Restart is required.
  4. Run the configuration Wizard
 you can Find Required Update and hot fix information at 
After that doing the above steps I am able to restore my site collection backup.