- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.SharePoint.Client;
- namespace GowthamSamples
- {
- class Program
- {
- static void Main(string[] args)
- {
-
- ClientContext clientContext = new ClientContext("http://gauti.sharepoint.com/sites/sp1/");
- GroupCollection Groups = context.Web.SiteGroups;
-
- Group ownersGroup = Groups.GetById(7);
-
- UserCreationInformation userCreationInfo = new UserCreationInformation();
- userCreationInfo.Email = "[email protected]";
- userCreationInfo.LoginName = "sharepointdev\\gowtham";
- userCreationInfo.Title = "User";
-
- User newUser = ownersGroup.Users.Add(userCreationInfo);
- context.ExecuteQuery();
- }
- }
- }
Thanks for reading my Blogs!