The organization where there are tight control over databases you often come across challenge to use DBAs created databases in SharePoint Configuration. The purpose of this post is to demonstrate how pre-created blank database can be attached to SharePoint Web Application.
The starting point is to create a blank database(ask your DBA to perform this task) or on sandbox for testing purposes you can do it yourself. When blank database is being created, make sure the Collation settings are 'Latin1_General_CI_AS_KS_WS'. Otherwise the scripts won't work.
Log on to SharePoint front end using account that has 'Shell_Admin' rights
Copy and paste scripts into notepad and save it as ps1 file. Note: "web url" is web application url that requires new content database. "pre-created db" is name of newly created db. The scripts assume new database is on default server. Use -DatabaseServer switch if database is on a different server.
Powershell reference can be found here:
http://technet.microsoft.com/en-us/library/ff607581.aspx
Scripts:
Add-PSSnapIn "Microsoft.SharePoint.Powershell"
$app = Get-SPWebApplication "web url"
Mount-SPContentDatabase -Name "pre-created db" -webapplication $app
Hope this helps !
Majid
I'm senior Developer/Consultant and passionate about Microsoft Technologies including Microsoft 365, SharePoint and .NET. I have been working in this industry for well over 10 years. This blog is all about sharing unique scenarios and tips of my project work which someone else might find handy too.
Subscribe to:
Post Comments (Atom)
Iconise ‘Add Picture’ control in PowerApps
Default look you get for ‘Add Picture’ control is not very appealing for end user and there is no OTB way of specifying icon for this con...
-
There's a very good article on business connectivity services which puts you on the right direction to start things with it. But when a...
-
Powershell command start-job does support running the script block under specified user. The command also supports various other feature w...
-
Popular SQL Grim - How to get around with it: After a long when when I tried to run Share Point on my laptop - rather me seeing the centr...
No comments:
Post a Comment