Thursday, June 24, 2010

Enable Claim Based Authentication for existing webapplication

Scenario:
While playing around with Claim provider I wanted to change my existing web application to use Claim provider , no UI option in Central Administration

Solution:
In SP2007 when ever Central Admin is missing an operation good chance was that STSADM will have something,so thinking of same. I knocked the door of POWERSHELL

Code:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue 

$webApplicationUrl=Read-Host "Enter a web application url"
$webapp= Get-SPWebApplication $webApplicationUrl 
$webapp.UseClaimsAuthentication
$webapp.UseClaimsAuthentication=$True
$webapp.Update()
$webapp.ProvisionGlobally()
iisreset

2 comments:

Anonymous,  June 7, 2011 at 5:08 AM  

thanks a lot!

Idaho October 25, 2012 at 1:49 PM  

Thanks, being able to get it done in Powershell is better anways since I should script the entire thing.