Update a SharePoint user field to only accept people - Powershell -


i'm adding field existing list doing...

$splist.fields.add(     "sourcemanager",     [microsoft.sharepoint.spfieldtype]::user,     $false )  $splist.fields["sourcemanager"].indexed = $true; $splist.fields["sourcemanager"].enforceuniquevalues = $true; $splist.fields["sourcemanager"].required = $true; $splist.fields["sourcemanager"].update(); 

this fine, want set field allow people (not people & groups default behavior here). can't find setting.

can point me in right direction?

you set selection mode field prior updating. 2 options presented below:

$splist.fields.add(     "sourcemanager",     [microsoft.sharepoint.spfieldtype]::user,     $false )  $splist.fields["sourcemanager"].indexed = $true; $splist.fields["sourcemanager"].enforceuniquevalues = $true; $splist.fields["sourcemanager"].required = $true;  $splist.fields["sourcemanager"].selectionmode = [microsoft.sharepoint.spfielduserselectionmode]::peopleandgroups; # people , groups. $splist.fields["sourcemanager"].selectionmode = [microsoft.sharepoint.spfielduserselectionmode]::peopleonly; # people only.   $splist.fields["sourcemanager"].update(); 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -