Tuesday, October 24, 2017

How to create managed property using powershell in sharepoint admin

$searchapp = Get-SPEnterpriseSearchServiceApplication -Identity c7276513-625d-4921-a2df-09c02c6007e2
$category = Get-SPEnterpriseSearchMetadataCategory –Identity SharePoint -SearchApplication $searchapp
$crawledproperty = New-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $searchapp -Category $category -VariantType 0 -PropSet "00130329-0000-0130-c000-000000131346" -Name "FAST_DBFIND_CCR.FAMILY_ID" -IsNameEnum $false
$managedproperty = New-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $searchapp -Name "FAMILYID" -Type 3 -FullTextQueriable $true -Queryable $true -Retrievable $true -SafeForAnonymous $true
New-SPEnterpriseSearchMetadataMapping -SearchApplication $searchapp -ManagedProperty $managedproperty -CrawledProperty $crawledproperty



PS C:\Users\SPDevServer> $managedproperty = New-SPEnterpriseSearchMetadataManage
dProperty -SearchApplication $searchapp -Name ACCOUNTNAME -Type 1 -FullTextQueri
able $true -Queryable $true -Retrievable $true -SafeForAnonymous $true
New-SPEnterpriseSearchMetadataManagedProperty : A managed property of the same
name ("ACCOUNTNAME") already exists.
At line:1 char:20
+ $managedproperty = New-SPEnterpriseSearchMetadataManagedProperty
-SearchApplicat ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : InvalidData: (Microsoft.Offic...ManagedProperty:
   NewSearchMetadataManagedProperty) [New-SPEnterpris...ManagedProperty], Inv
  alidNameException
    + FullyQualifiedErrorId : Microsoft.Office.Server.Search.Cmdlet.NewSearchM
   etadataManagedProperty

PS C:\Users\SPDevServer> New-SPEnterpriseSearchMetadataMapping -SearchApplicatio
n $searchapp -ManagedProperty $managedproperty -CrawledProperty $crawledproperty

New-SPEnterpriseSearchMetadataMapping : Cannot bind argument to parameter
'ManagedProperty' because it is null.
At line:1 char:86
+ ... anagedProperty $managedproperty -CrawledProperty $crawledproperty
+                    ~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [New-SPEnterpriseSearchMetadata
   Mapping], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,M
   icrosoft.Office.Server.Search.Cmdlet.NewSearchMetadataMapping

PS C:\Users\SPDevServer> $managedproperty = New-SPEnterpriseSearchMetadataManage
dProperty -SearchApplication $searchapp -Name "COMPANYNAME" -Type 1 -FullTextQue
riable $true -Queryable $true -Retrievable $true -SafeForAnonymous $true
PS C:\Users\SPDevServer> New-SPEnterpriseSearchMetadataMapping -SearchApplicatio
n $searchapp -ManagedProperty $managedproperty -CrawledProperty $crawledproperty



CrawledPropset             : 00130329-0000-0130-c000-000000131346
CrawledPropertyName        : FAST_DBFIND_CCR.ACCOUNTNAME
CrawledPropertyVariantType : 0
ManagedPid                 : 1002



PS C:\Users\SPDevServer> $managedproperty = New-SPEnterpriseSearchMetadataManage
dProperty -SearchApplication $searchapp -Name "CREATEDATE" -Type 1 -FullTextQuer
iable $true -Queryable $true -Retrievable $true -SafeForAnonymous $true
PS C:\Users\SPDevServer> New-SPEnterpriseSearchMetadataMapping -SearchApplicatio
n $searchapp -ManagedProperty $managedproperty -CrawledProperty $crawledproperty



CrawledPropset             : 00130329-0000-0130-c000-000000131346
CrawledPropertyName        : FAST_DBFIND_CCR.ACCOUNTNAME
CrawledPropertyVariantType : 0
ManagedPid                 : 1003



PS C:\Users\SPDevServer> $managedproperty = New-SPEnterpriseSearchMetadataManage
dProperty -SearchApplication $searchapp -Name "DBID" -Type 3 -FullTextQueriable
$true -Queryable $true -Retrievable $true -SafeForAnonymous $true
PS C:\Users\SPDevServer> New-SPEnterpriseSearchMetadataMapping -SearchApplicatio
n $searchapp -ManagedProperty $managedproperty -CrawledProperty $crawledproperty



CrawledPropset             : 00130329-0000-0130-c000-000000131346
CrawledPropertyName        : FAST_DBFIND_CCR.ACCOUNTNAME
CrawledPropertyVariantType : 0
ManagedPid                 : 1004



PS C:\Users\SPDevServer> $managedproperty = New-SPEnterpriseSearchMetadataManage
dProperty -SearchApplication $searchapp -Name "DOCENGINEER" -Type 3 -FullTextQue
riable $true -Queryable $true -Retrievable $true -SafeForAnonymous $true
PS C:\Users\SPDevServer> New-SPEnterpriseSearchMetadataMapping -SearchApplicatio
n $searchapp -ManagedProperty $managedproperty -CrawledProperty $crawledproperty



CrawledPropset             : 00130329-0000-0130-c000-000000131346
CrawledPropertyName        : FAST_DBFIND_CCR.ACCOUNTNAME
CrawledPropertyVariantType : 0
ManagedPid                 : 1005



PS C:\Users\SPDevServer> $managedproperty = New-SPEnterpriseSearchMetadataManage
dProperty -SearchApplication $searchapp -Name "ENGINEER" -Type 3 -FullTextQueria
ble $true -Queryable $true -Retrievable $true -SafeForAnonymous $true
PS C:\Users\SPDevServer> New-SPEnterpriseSearchMetadataMapping -SearchApplicatio
n $searchapp -ManagedProperty $managedproperty -CrawledProperty $crawledproperty



CrawledPropset             : 00130329-0000-0130-c000-000000131346
CrawledPropertyName        : FAST_DBFIND_CCR.ACCOUNTNAME
CrawledPropertyVariantType : 0
ManagedPid                 : 1006



PS C:\Users\SPDevServer> $managedproperty = New-SPEnterpriseSearchMetadataManage
dProperty -SearchApplication $searchapp -Name "FAMILYID" -Type 3 -FullTextQueria
ble $true -Queryable $true -Retrievable $true -SafeForAnonymous $true
PS C:\Users\SPDevServer> New-SPEnterpriseSearchMetadataMapping -SearchApplicatio
n $searchapp -ManagedProperty $managedproperty -CrawledProperty $crawledproperty



CrawledPropset             : 00130329-0000-0130-c000-000000131346
CrawledPropertyName        : FAST_DBFIND_CCR.ACCOUNTNAME
CrawledPropertyVariantType : 0
ManagedPid                 : 1007



PS C:\Users\SPDevServer>

No comments:

Power Automate + Excel data

Extract excel data, get manager and update row with user details which will get from GET MANAGER Concepts and examples Key column:  Column i...