Tuesday 18 October 2016

SharePoint 2016 : Create Web Application and Site Collection Using PowerShell.

This post will help you on how to create Web Application and Site Collection using PowerShell.

i am going to create Web Application as  http:Sharepoint with port 32789.

Before we create lets see the web application list i have in my farm.





So lets get started.

Creating Web Application

Open SharePoint Management shell or Windows Powershell ISE run it as administrator.

Run below PowerShell Script

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
$authentication = New-SPAuthenticationProvider -UseWindowsIntegratedAuthentication -DisableKerberos

New-SPWebApplication -Name "SharePoint2016" -Port 32789 -ApplicationPool
"SharePoint2016" -ApplicationPoolAccount (Get-SPManagedAccount "Sutta\Administrator")
-AuthenticationMethod NTLM -AuthenticationProvider $authentication


It will take some time to create and once successful you will see the below screen.

Now, go and check web application list again.


New Web application has been created and added to the list.


Creating Site Collection

Run below PowerShell command  to create a site collection

New-SPSite http://sharepoint:32789/Sites/SP -OwnerAlias "Sutta\Administrator" -Name "Root" -Template "STS#0"

It will take some time to create and once successful you will see the below screen.





Now, we again check the site collection list.


Site collection has been created.


Happy SharePointing :)
 



No comments:

Post a Comment