onsdag den 7. september 2011

SharePoint 2010–Set custom sign in page

this one took me several hours. So much crap on Google but no solution anywhere.

If your SharePoint site is using Classic Mode Authentication

$webappurl = 'https://web.site.com'
Set-SPCustomLayoutsPage -Identity Login -RelativePath "/_layouts/something/login.aspx" -WebApplication $webappurl

To remove it again use

$webappurl = 'https://web.site.com'
Set-SPCustomLayoutsPage -Identity Login -reset -WebApplication $webappurl

If how ever your site is using Claims Based Authentication this wont work. Then use

$webappurl = 'https://web.site.com'
Set-SPWebApplication $webappurl -zone Default -SignInRedirectURL "/_layouts/wingu.SharePoint.Authentication/login.aspx"

And to remove it (reset it) again use

$webappurl = 'https://web.site.com'
Set-SPWebApplication $webappurl -zone Default -SignInRedirectURL ""

And a not to my self on how to do it on all websites

get-SPWebApplication | foreach-object {
    $_
    $ap1 = Get-SPTrustedIdentityTokenIssuer
    $ap2 = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication
    Set-SPWebApplication $_.Url -AuthenticationProvider $ap1, $ap2 -zone Default -SignInRedirectURL "/_layouts/wingu.SharePoint.Authentication/login.aspx"
}

Ingen kommentarer:

Send en kommentar