I have create Web application in sharepoint 2013 but I want to apply Form Base Authentication Using Powershell script.
You can follow there steps. This steps are just brief introduction:
- Create the Custom SQL Authentication Database
- Configure the Membership Provider
- Configure a SharePoint Web Application for Form-Based Authentication
- Add Users from IIS
The detail script is given here
Using powershell to configure the FBA is not easy job But Thanks to MSFt scripting guy, who wrote the extensive script to configure the FBA wither with LDAP or SQL.
Script allows an IT admin to configure LDAP or SQL based FBA on SharePoint 2010/2013 web applications i.e. it makes all the changes in web.config files of Central Admin, STS and web applications on all the Servers automatically minimizing the possibility of human error and drastically reducing the time and effort. It also puts in place basic checks like SQL/LDAP connectivity checks, duplicates, web application eligibility for FBA. Most important it takes the backup of each file before modifying anything providing a kind of failback mechanism in case of issues
You can read or directly download it from here: Configuring FBA (SQL or LDAP) for SP 2010 and SP 2013
Copy the script on one of the SharePoint Servers in the farm where you want to configure the FBA.
Run the script and it will ask for the following parameters
- Web application URL.
- Select the Zone of the web application.
- Type of FBA ( SQL or LDAP)
- RoleManager and Membership information needed for configuring requested LDAP.