将用户添加到共享点组 [英] Adding User to a sharepoint group
问题描述
我想知道如何使用客户端对象模型将用户和与该用户相关的字段添加到共享点组.
I would like to know how can i use client side object model to add user and and fields related to that user to a sharepoint group.
例如.该组称为 SameDay ,其列为:
For Example. The group is called SameDay and its columns are :
用户名(人员或组).
ServiceLevelType(单行文本).
ServiceLevelType (single line of text).
Group_id(单行文本).
Group_id (single line of text).
说明(单行文字).
谢谢
推荐答案
首先通过CSOM将用户添加到组中,例如:
at first add user to group via CSOM, here is example:
以编程方式将用户添加到SharePoint组C#CSOM SharePoint 2013
然后在隐藏的用户信息列表(_catalogs/用户)中为用户找到合适的列表项,并更新提到的字段:
then find appropriate list item for the user in hidden User information list (_catalogs/users) and update mentioned fields:
以下是有关用户信息列表的更多信息: SharePoint的隐藏用户列表-用户信息列表.特别是您需要:
Here are more information about User information list: SharePoint's hidden user-list - User Information List. Particularly you need that:
SPListItem userItem = userInformationList.Items.GetItemById(user.ID);
即,为了获取适当用户的列表项,您需要将该用户的ID传递给GetItemById方法.
i.e. in order to get list item for appropriate user you need to pass ID of that user to GetItemById method.
这篇关于将用户添加到共享点组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!