Categories
Uncategorized

Enabling FBA and NTLM Claims-based authentication with PowerShell

On the interwebz I couldn’t find any way to set multiple Authentication Providers on a Web Application and I need to set the Authentication Providers to NTLM ánd FBA. The examples always show one Authentication Provider. Turns out the solution is very simple:

[code gutter=”false” lang=”powershell”]
$NTLM = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos
$FBA = New-SPAuthenticationProvider -ASPNETMembershipProvider "MyMembershipProvider" -ASPNETRoleProviderName "MyRoleProvider"
$webApplication.UseClaimsAuthentication = $true
$webApplication.Update()
$webApplication.MigrateUsers($true)

Set-SPWebApplication -AuthenticationProvider $NTLM,$FBA -Identity $webApplication -Zone "Default"
[/code]

Leave a Reply