How to make User Field Type to restrict to SharePoint group using CAML Query, PowerShell.

$fieldXMLString = '<Field Type="User"
Name="'+$fieldName+'"
DisplayName="Primary Site Owner"
StaticName="'+$fieldName+'"
Group="'+$group+'"
UserSelectionMode="PeopleOnly"
Required="TRUE">
</Field>'

In the above code, I need to add another property which will point to SharePoint group. By doing this my control will be limited to a set of people.

This should be similar to SharePoint Choose from option using GUI. Regards, Vikrant

有帮助吗?

解决方案

You can use UserSelectionScope="GroupID" attribute to specify a group. GroupID is a group ID (integer).

You can see property description on the MSDN field schema description page

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top