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
Post a Comment