How can I Enforce unique values: in powershell? Client-side as well not server-side Here is the code that I have :
$ListInfo = New-Object Microsoft.SharePoint.Client.ListCreationInformation
$ListInfo.Title = $ListTitle
$ListInfo.TemplateType = "100"
$myList = $web.Lists.Add($ListInfo)
$myList.Description = $ListTitle
$myList.Update()
$Fields=$myList.Fields
$ctx.Load($Fields)
$ctx.ExecuteQuery()
$myList.Fields.AddFieldAsXml("<Field Type='Number' DisplayName='SortOrder' />",$true,[Microsoft.SharePoint.Client.AddFieldOptions]::AddFieldToDefaultView)
$myList.Update()
$ctx.ExecuteQuery()
just need to make it a unique field
enforce unique values