-
StackOverflow 文件
-
sharepoint 教程
-
使用託管客戶端物件模型(CSOM)
-
組。將使用者新增到 SharePoint 組
ClientContext clientContext = new ClientContext("http://MyServer/sites/MySiteCollection ");
GroupCollection collGroup = clientContext.Web.SiteGroups;
Group oGroup = collGroup.GetById(6);
UserCreationInformation userCreationInfo = new UserCreationInformation();
userCreationInfo.Email = "alias@somewhere.com";
userCreationInfo.LoginName = @"DOMAIN\alias";
userCreationInfo.Title = "John";
User oUser = oGroup.Users.Add(userCreationInfo);
clientContext.ExecuteQuery();