Create a SharePoint Web application through PowerShell

in #sharepoint6 years ago (edited)

Hello friends, in this article I'll tell you how to create a web application in SharePoint 2013 through PowerShell script.

Demo: Now I am going to create a web application with port 5566:

Steps:

First please open "SharePoint 2013 Management Shell

  • use help command followed by command name for more information --> "help New-SPWebApplication"

  • create an authentication provider for use further in creation of web application -->
    $ap = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos

  • use follwoing script for create a web application
    PS C:\Users\myUsername> New-SPWebApplication -Name "Fresher site - 5566" -Port 5566 -URL "http://dsknomoe12:5566/" -ApplicationPool "SharePoint - 80" -ApplicationPoolAccount (Get-SPManagedAccount "myPC\myUsername") -AuthenticationProvider $ap


Another way:

PS C:\Users\myUsername> New-SPWebApplication -Name "Fresher site" -Port 5566 -URL "http://dsknomoe12" -ApplicationPoolAccount (Get-SPManagedAccount "myPC\myUsername") -AuthenticationProvider $ap

cmdlet New-SPWebApplication at command pipeline position 1

Supply values for the following parameters:

ApplicationPool: FresherAppPool
image.png

WOW, WebApplication created successfully….

Sort:  

@tabrez-ajaz, I gave you an upvote on your first post! Please give me a follow and I will give you a follow in return!

Please also take a moment to read this post regarding bad behavior on Steemit.