Frage

I would like to index a column in a list with powershell.

I have a problem, when i retrieve the list how can i set what field should be put to index? Is there a special command, can anyone provide me with example or give me a hint how to implement it.

Thanks

War es hilfreich?

Lösung

If I understand correctly you can retrieve field form filed collection of a list and set Indexed property to true

$web = Get-SPWeb http://sharepoint
$spList = $web.Lists["ListName"]
$spField = $spList.Fields["FieldName"]
$spField.Indexed = $true
$spField.Update()
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit sharepoint.stackexchange
scroll top