Thursday 18 June 2015

Create a claims-based web application by using Windows PowerShell

Use the procedure in this section to create a new claims-based SharePoint 2013 web application using Windows PowerShell.
To create a claims-based web application by using Windows PowerShell
  1. Verify that you have the following memberships:
    • securityadmin fixed server role on the SQL Server instance.
    • db_owner fixed database role on all databases that are to be updated.
    • Administrators group on the server on which you are running Windows PowerShell cmdlets.
    • You must read about_Execution_Policies.
    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 15 Products cmdlets.
    NoteNote:
    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Permissions and Add-SPShellAdmin.
  2. To create a claims-based authentication provider, from the Windows PowerShell command prompt, type the following:
    $ap = New-SPAuthenticationProvider
    
  3. To create a claims-based web application, from the Windows PowerShell command prompt, type the following:
    New-SPWebApplication -Name <Name> 
    -ApplicationPool <ApplicationPool> 
    -ApplicationPoolAccount <ApplicationPoolAccount> 
    -URL <URL> -Port <Port> -AuthenticationProvider $ap
    
    Where:
    • <Name> is the name of the new web application that uses claims-based authentication.
    • <ApplicationPool> is the name of the application pool.
    • <ApplicationPoolAccount> is the user account that this application pool will run as.
    • <URL> is the public URL for this web application.
    • <Port> is the port on which the web application will be created in IIS.
    NoteNote:
    For more information, see New-SPWebApplication.
    The following example creates an https claims-based web application, using the current user credentials and the current machine name:
    $ap = New-SPAuthenticationProvider
    New-SPWebApplication -Name "Contoso Internet Site" -URL "https://www.contoso.com"  -Port 80 
    -ApplicationPool "ContosoAppPool" 
    -ApplicationPoolAccount (Get-SPManagedAccount "DOMAIN\jdoe") 
    -AuthenticationProvider $ap -SecureSocketsLayer
    
    NoteNote:
    After you have created the web site, you must configure SSL in IIS for this newly created web site. For more information about how to set up SSL, see How to Setup SSL on IIS 7.0.

No comments:

Post a Comment