Creating Content Database on a given Web application

Today I am providing the Power Shell Script that create content database for a given web application on the given server.
.Inputs
Web Application : Provide the webapplication URL where you want a new database.
Database Name : Provide new Database name.
SQL Server : SQL server where new database will be created.
.Outputs
This script will Create new content database for a given webapplication on a given SQL server.
Example-
.\scriptname.ps1
.\scriptname.ps1 | out-file “FilePath\Filename.txt”
Dependencies –
SharePoint Farm Admin must have DBCreator rights on the SQL server if you are creating Database on different server other than SharePoint Farm Server.
For executing this script user must be added in site collection administrators given site.
User should have Shell Admin rights to run the scripts.
Run Management Shell as an Administrator.
How to execute -
Copy this script and paste in Note pad.
Save this file as .ps1.
Run this script in SharePoint Management Shell. You can run this script in PowerShell as well.
Follow on screen instructions.
FOR ANY HELP ON THIS SCRIPT USE "GET-HELP .\SCRIPTNAME.PS1 --FULL" AFTER SAVING THIS FILE.
Go to above link to get the script.


No comments:

Post a Comment