SharePoint 2013 Databases without the GUID

When you configure SharePoint 2013 it will create the SharePoint_AdminContent database with a GUID at the end. To keep my database names clean I searched for a solution.

To be able to set the name of the database you will have to perform the configuration with PowerShell.

Take the following steps:

1. Open SharePoint 2013 Management Shell as Administrator.

2. Type the following:

New-SPConfigurationDatabase -DatabaseName BETA_SP2013_Config –AdministrationContentDatabaseName BETA_SP2013_AdminContent –DatabaseServer SP2013DB -FarmCredentials (get-credential)

3. You will get a pop-up to fill in the farm credentials. Fill in the account you want to use to run central administration under. When you filled in the account the management shell will also ask you to fill in the passphrase for joining servers to your farm.

4. Install the help collection files by running the following script.

Install-SPHelpCollection –All

5. Initialize the SharePoint Security by running the following script.

Initialize-SPResourceSecurity

6. Register the SharePoint Services by running the following script.

Install-SPService

7. Create central administration by running the following script.

New-SPCentralAdministration -Port 5555 -WindowsAuthProvider “ntlm”

8. Install the application content by running the following script.

Install-SPApplicationContent

9. When everything is done. You performed the steps the configuration wizard does for you. To be absolutely sure that everything is configured run the configuration wizard.

 

After these steps SharePoint is configured with a clean database name!

Almost all other SharePoint databases can be named trough the UI only the Search Service Application and the Usage service create there own databases. The solution is to also create these services  with PowerShell.

In other for you to create the Search Service Application you can use the script below (You only have to change the arguments on the top).

$databaseServer = "SP2013DB"
$ServiceAppPool = "SharePoint Services Application Pool"
$IndexLocation = "C:\SP2013_Search"
$SearchServiceApplicationName = "Search Service Application"
$server = "CLAY"

Write-Host "Setting up Search"

Start-SPEnterpriseSearchServiceInstance $server
Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $server

$searchApp = New-SPEnterpriseSearchServiceApplication -Name $SearchServiceApplicationName -ApplicationPool $ServiceAppPool -DatabaseServer $databaseServer -DatabaseName "BETA_SP2013_Search"
$searchInstance = Get-SPEnterpriseSearchServiceInstance $server

$ssa = Get-SPEnterpriseSearchServiceApplication 

Write-Host "Setup Topology"
$ssa.ActiveTopology
$clone = $ssa.ActiveTopology.Clone()

New-SPEnterpriseSearchAdminComponent –SearchTopology $clone -SearchServiceInstance $searchInstance
New-SPEnterpriseSearchContentProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchInstance
New-SPEnterpriseSearchAnalyticsProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchInstance 
New-SPEnterpriseSearchCrawlComponent –SearchTopology $clone -SearchServiceInstance $searchInstance 
New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $searchInstance -RootDirectory $IndexLocation
New-SPEnterpriseSearchQueryProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchInstance

$clone.Activate()

$ssa | get-SPEnterpriseSearchAdministrationComponent |  set-SPEnterpriseSearchAdministrationComponent -SearchServiceInstance  $searchInstance


Write-Host "Setup Proxy"
$searchAppProxy = New-SPEnterpriseSearchServiceApplicationProxy -Name "$SearchServiceApplicationName Proxy" -SearchApplication $SearchServiceApplicationName > $null

Write-Host "Done"

 

You need to take the steps below to create the Usage Service Application:

1. Get the Usage Service.

$serviceInstance = Get-SPUsageService

2. Create the service application.

New-SPUsageApplication -Name "Usage Service Application -DatabaseServer SP2013DB -DatabaseName "BETA_SP2013_UsageDB" -UsageService $serviceInstance > $null

3.  Get the proxy off the application and provision it.

$usa = Get-SPServiceApplicationProxy | where {$_.TypeName -like "Usage*"} 
$usa.Provision()

Related Posts

Forcing a Device Channel Device channels are a way of using different master pages for different devices. MSDN describes the functionality as followed:   “Browsing ...
Offline Installation SharePoint 2013 In many situation you would like to do a offline installation of SharePoint 2013 or you are required to do a offline installation because you do not h...
User automatically removed from SharePoint Group During my current project we received an access request from a user. We did what we normally do, we checked the request and added the user in the appr...
Unable to start User Profile Synchronization Service A few days ago I wrote a post about loading modules in PowerShell by default: “Load modules by default when opening PowerShell”. Today we had to setup...
Filtering SharePoint Search Results by Content Source Working for one my projects we were looking for a solution to only retrieve search results for a specific Content Source. In our scenario we had a Ext...
PowerShell Scripts During my current project we are using a lot of PowerShell scripts to administrate the environment and make development easier for us. In this post...

5 comments

  • When can I performed the below ? :

    New-SPConfigurationDatabase -DatabaseName BETA_SP2013_Config –AdministrationContentDatabaseName BETA_SP2013_AdminContent –DatabaseServer SP2013DB -FarmCredentials (get-credential)

    Is it after I performed the normal installation of Sharepoint 2013 ?

  • Hi,

    Great post. I keep getting the following error when trying to run the script for the Search setup. Do you have any idea why?

    New-SPEnterpriseSearchServiceApplication : Value cannot be null.
    Parameter name: applicationPool
    At C:\Users\sp_admin.DOMAIN\Documents\search.ps1:12 char:14
    + $searchApp = New-SPEnterpriseSearchServiceApplication -Name
    $SearchServiceApplic …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~
    + CategoryInfo : InvalidData: (Microsoft.Offic…viceApplication:
    NewSearchServiceApplication) [New-SPEnterpriseSearchServiceApplication], A
    rgumentNullException
    + FullyQualifiedErrorId : Microsoft.Office.Server.Search.Cmdlet.NewSearchS
    erviceApplication

    • Hi Joe,

      It looks like you have a problem regarding your parameter “ApplicationPool” please check if everything goes correct on the Command: New-SPEnterpriseSearchServiceApplication regarding the application pool you specify.

  • This is great and the first part worked like a charm for me, but I thought I would point out that if you’re using SharePoint Foundation 2013, New-SPEnterpriseSearchServiceApplication is intentionally blocked by Microsoft. You have to have SharePoint Enterprise in order to use those commands. I’m torn now between seeing if we can upgrade to SP 2013 Enterprise or using some of the hacks I’ve seen around the interwebs. Microsoft also seems to have posted a procedure to rename the search databases:

    https://technet.microsoft.com/en-us/library/jj219654.aspx

    Why they couldn’t just fix the installer to allow us to set the DB name during the install, I’ll never know!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.