I am just in the process of writing some PowerShell Scripts to import Managed Metadata Properties and Crawled properties from an XML configuration file and came across a small point that I felt needed recording.

I will probably write a fuller post with the XML Config, XSD schema and Powershell components later, when I have finished and tested it, but wanted to provide this bit straight away.

I won't go into the details of the PowerShell here as Corey Roth has already given the basics here:
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/05/26/creating-enterprise-search-metadata-property-mappings-with-powershell.aspx

One bit that he is missing is the -Type value that you pass into the following cmdlet 'New-SPEnterpriseSearchMetadataManagedProperty'

According to Technet (http://technet.microsoft.com/en-us/library/ff608089.aspx) it should be one of the following 'Int32' values

  • Text
  • Integer
  • Decimal
  • DateTime
  • YesNo
  • Binary

I think you see the problem?

So, What we need to pass into the -Type parameter for that cmdlet is the Int32 value for those types.  Corey didn't gt round to working them out, so I have got them here:

​TypeInt32​
​Text 1​
Integer​ 2​
Decimal​ 3​
DateTime​ 4​
YesNo​ 5​
Binary Data​ 6​

Hope this helps.