Create search metadata ing
$ Searchapp = Get-spenterprisesearchserviceapplication
New-spenterprisesearchmetadatamanagedproperty-searchapplication $ searchapp-name Mei-type 2-description "sumeihua"
$ Mei = Get-spenterprisesearchmetadatamanagedproperty-searchapplication $ searchapp-identity Mei
$ Cmei = Get-spenterprisesearchmetadatacrawledproperty-searchapplication $ searchapp-name return. Series
$ Cmei1 = Get-spenterprisesearchmetadatacrawledproperty-searchapplication $ searchapp-name return. subscribes
New-spenterprisesearchmetadatamapping-searchapplication $ searchapp-crawler property $ cmei-managedproperty $ Mei
New-spenterprisesearchmetadatamapping-searchapplication $ searchapp-crawler property $ cmei1-managedproperty $ Mei
:
If the ing is not deleted, an error is returned when metadata is deleted.
Delete search metadata: first, delete the search metadata ing.
$ Pssnapinlogs poin = Get-pssnapin Microsoft. Sharepoint. powershell-erroraction silentlycontinue
If ($ pssnapin1_poin-EQ $ null)
{
Add-pssnapin Microsoft. Sharepoint. powershell;
}
$ Searchapp = Get-spenterprisesearchserviceapplication
$ MP = Get-spenterprisesearchmetadatamanagedproperty-searchapplication $ searchapp-identity Su
$ Mapmei = Get-spenterprisesearchmetadatamapping-searchapplication $ searchapp-managedproperty $ MP
Foreach ($ _ in $ mapmei)
{
$ Prop = Get-spenterprisesearchmetadatacrawledproperty-searchapplication $ searchapp-name $ _. crawledpropertyname
$ Map = Get-spenterprisesearchmetadatamapping-searchapplication $ searchapp-crawler property $ prop-managedproperty $ MP
$ Map | remove-spenterprisesearchmetadatamapping
}
$ MP | remove-spenterprisesearchmetadatamanagedproperty