SPSearchCrawlDatabase - dsccommunity/SharePointDsc GitHub Wiki

Parameters

Parameter Attribute DataType Description Allowed Values
DatabaseName Key String The name of the crawl database
ServiceAppName Key String The name of the search service application
DatabaseCredentials Write PSCredential If using SQL authentication, the SQL credentials to use to connect to the instance
DatabaseServer Write String The server that should host the crawl databases
Ensure Write String Present if the crawl database should exist, absent if it should not Present, Absent
UseSQLAuthentication Write Boolean Should SQL Server authentication be used to connect to the database?

Description

Type: Distributed Requires CredSSP: No

This resource is responsible for managing crawl databases of a Search topology and is able to add to and remove databases from the topology.

The default value for the Ensure parameter is Present. When not specifying this parameter, the service application is provisioned.

Examples

Example 1

This example shows how add a new Search Crawl database to a search application.

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $SetupAccount
    )
    Import-DscResource -ModuleName SharePointDsc

    node localhost
    {
        SPSearchCrawlDatabase CrawlDatabase
        {
            DatabaseName         = 'SP_Search_Crawl_2'
            ServiceAppName       = 'Search Service Application'
            Ensure               = 'Present'
            PsDScRunAsCredential = $SetupAccount
        }
    }
}

Example 2

This example shows how remove a Search Crawl database from a search application.

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $SetupAccount
    )
    Import-DscResource -ModuleName SharePointDsc

    node localhost
    {
        SPSearchCrawlDatabase CrawlDatabase
        {
            DatabaseName         = 'SP_Search_Crawl_2'
            ServiceAppName       = 'Search Service Application'
            Ensure               = 'Absent'
            PsDScRunAsCredential = $SetupAccount
        }
    }
}