In SharePoint you can configure a FbaMembershipProvider so that you can store and retrieve membership data from SQL Server. Unlike AD, you don’t have a real management tool for managing FBA users. In cases like this, where you want to help people out when they locked their account or they need a password reset, you can always go to PowerShell.
The first step is of course launching PowerShell. Then you have to “prep” your session so that you can connect to the SQL database. When you’ve already configured your Web Application’s web.config file, you’re good to go. All you need to do is load in that web.config file so the connectionstrings are available.
Do this by the following statement:
When you’ve loaded your config file, it’s time to initialize the System.Web assembly.
When the assembly gets loaded, the config path is used to read data for the membership providers.
You can list all available membership providers:
We’re gonna need the second one. The collection let’s us index on the “Name” property so we’ll go ahead and select the second one:
$provider = [System.Web.Security.Membership]::Providers["FbaMembershipProvider"]
Now that we have the $provider object, we can use all the useful methods it offers:
ChangePassword ChangePasswordQuestionAndAnswer CreateUser DeleteUser FindUsersByEmail FindUsersByName GeneratePassword GetAllUsers GetHashCode GetNumberOfUsersOnline GetPassword GetUser GetUserNameByEmail ResetPassword UnlockUser UpdateUser ValidateUser