using(ClientContext clientContext = new ClientContext("http://Test.sharepoint.com/sites/TestSite/"))
{
GroupCollection Groups = context.Web.SiteGroups;
//Get the group by its name
Group ownersGroup = Groups.GetByName("GroupName");
// Create the new user info
UserCreationInformation userCreationInfo = new UserCreationInformation();
userCreationInfo.Email = "Parthasarathy@sharepoint.com";
userCreationInfo.LoginName = "sharepoint\\Parthasarathy";
userCreationInfo.Title = "User";
// Add the user to the group
User newUser = ownersGroup.Users.Add(userCreationInfo);
context.ExecuteQuery();
}
{
GroupCollection Groups = context.Web.SiteGroups;
//Get the group by its name
Group ownersGroup = Groups.GetByName("GroupName");
// Create the new user info
UserCreationInformation userCreationInfo = new UserCreationInformation();
userCreationInfo.Email = "Parthasarathy@sharepoint.com";
userCreationInfo.LoginName = "sharepoint\\Parthasarathy";
userCreationInfo.Title = "User";
// Add the user to the group
User newUser = ownersGroup.Users.Add(userCreationInfo);
context.ExecuteQuery();
}