SPSearchMetadataCategory - dsccommunity/SharePointDsc GitHub Wiki

Parameters

Parameter Attribute DataType Description Allowed Values
Name Key String The name of the Metadata Category
ServiceAppName Key String The name of the search service app that this Metadata Category exists within
AutoCreateNewManagedProperties Write Boolean Specifies that when a new crawled property in this category is found, a corresponding managed property is created and mapped to this new crawled property
DiscoverNewProperties Write Boolean Specifies that if there are unknown properties in this category, these new properties are discovered during a crawl.
Ensure Write String Present if the result source should exist, absent if it should not Present, Absent
MapToContents Write Boolean Specifies that all crawled properties of type string are mapped to corresponding managed properties of this category.

Description

Type: Distributed Requires CredSSP: No

This resource will deploy and configure a Metadata Category in a specified search service application.

The default value for the Ensure parameter is Present. When not specifying this parameter, the Metadata Category is created.

Examples

Example 1

This example shows how to create a new Search Metadata Category, using the required parameters

Configuration Example
{
    param
    (
        [Parameter(Mandatory = $true)]
        [PSCredential]
        $SetupAccount
    )

    Import-DscResource -ModuleName SharePointDsc

    node localhost
    {
        SPSearchMetadataCategory NewCategory
        {
            Name                           = "My New category"
            ServiceAppName                 = "Search Service Application"
            AutoCreateNewManagedProperties = $true
            DiscoverNewProperties          = $true
            MapToContents                  = $true
            Ensure                         = "Present"
            PsDscRunAsCredential           = $SetupAccount
        }
    }
}