SharePoint Management Shell- List out all authentication Providers for each zone in each web Application in your farm

You may find yourself hunting for the SharePoint Web application and looking through each authentication zone to find the ones associated with a certain Auth Provider.  This can happen if you've ever tried removing a claims authentication provider, but the error indicates that it is associated with one or more web applications.

The following script will give you the details you need:

$webapps = get-spwebapplication
foreach ($webapp in $webapps)
Write-Host "===================Start Web Application" $webapp.Name "=====================" -foreground Green;
Write-Host "Web Application Name: " $webapp.Name;
Write-Host "Web Application URL: " $webapp.URL;
foreach ($zone in $webapp.IisSettings.Keys)
Write-Host "--------------------------";
Write-Host "Zone: " $zone -foreground Magenta;
Write-Host "Authentication Provider:";
Write-Host "--------------------------";
Get-SPAuthenticationProvider -WebApplication $webapp -zone $zone;
Write-Host "--------------------------";
Write-Host "====================End Web Application" $webapp.Name "=====================`n`n" -foreground Green;

One additional thing to note here, is that this script can be modified to give you the following information about each extended and mapped zone (each mapped zone correlates to an IIS site with these settings):

AuthenticationMode                               : Forms
MembershipProvider                               : i
RoleManager                                      : c
AllowAnonymous                                   : False
EnableClientIntegration                          : True
ServerBindings                                   : {Microsoft.SharePoint.Admini
SecureBindings                                   : {}
UseWindowsIntegratedAuthentication               : True
UseBasicAuthentication                           : False
DisableKerberos                                  : True
ServerComment                                    : SharePoint - 5555
Path                                             : C:\inetpub\wwwroot\wss\Virtu
PreferredInstanceId                              : 479071364
UseClaimsAuthentication                          : True
ClaimsAuthenticationRedirectionUrl               :
UseFormsClaimsAuthenticationProvider             : True
FormsClaimsAuthenticationProvider                : Microsoft.SharePoint.Adminis
UseTrustedClaimsAuthenticationProvider           : False
UseWindowsClaimsAuthenticationProvider           : False
OnlyUseWindowsClaimsAuthenticationProvider       : False
WindowsClaimsAuthenticationProvider              :
ClaimsAuthenticationProviders                    : {Forms Authentication}
ClaimsProviders                                  : {}
ClientObjectModelRequiresUseRemoteAPIsPermission : True
UpgradedPersistedProperties                      : {}

This can be done by using:
foreach ($iissettings in $webapp.IisSettings)

Comments (0)

Skip to main content