Skip Ribbon Commands
Skip to main content

Aghy's SharePoint Journey

:

Aghy.hu > Aghy's SharePoint Journey > Posts > PowerShell script for exporting Crawled Properties (FS4SP)
May 01
PowerShell script for exporting Crawled Properties (FS4SP)

Recently, I was working with FAST Search Server 2010 for SharePoint (FS4SP) and had to provide a list of all crawled properties in the category “MyCategory”. Here is my pretty simple script that provides the list in a .CSV file:

$outputfile = "CrawledProperties.csv"

if (Test-Path $outputfile) { clear-content $outputfile }

foreach ($crawledproperty in (Get-FASTSearchMetadataCrawledProperty))
{
    $category = $crawledproperty.categoryName
    if ($category = "MyCategory")
    {

        # Get the name and type of the crawled property
        $name = $crawledproperty.name
        $type = $crawledproperty.VariantType

        switch ($type) {
            20 {$typestr = "Integer"}
            31 {$typestr = "Text"}
            11 {$typestr = "Boolean"}
            64 {$typestr = "DateTime"}
            default {$typestr = “other”}

        }
        # Build the output: $name and $typestr separated by “ “ 
        $msg = $name + " " + $typestr

        Write-output $msg | out-file $outputfile -append
    }
}

$msg = "Crawled properties have been exported to the file " + $outputfile
write-output ""
write-output $msg
write-output ""
write-output ""

Comments

There are no comments for this post.

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Name *


E-Mail *


Url


Title


Body *


Today's date *

Select a date from the calendar.
Please enter today's date (CST) so I know you are a real person.

Attachments

 

 Sponsors

 

Hosted by
 FpWeb.net