Question

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

Était-ce utile?

La solution

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()
Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top