Retrieve all Users in SharePoint 2013 Group using CSOM

    1. using System;  
    2. using System.Collections.Generic;  
    3. using System.Linq;  
    4. using System.Text;  
    5. using System.Threading.Tasks;  
    6. using Microsoft.SharePoint.Client;  
    7. namespace GowthamSamples  
    8. {  
    9.     class Program   
    10.     {  
    11.         static void Main(string[] args)  
    12.       {  
    13.             // ClientContext - Get the context for the SharePoint Site  
    14.             ClientContext clientContext = new ClientContext("http://gauti.sharepoint.com/sites/sp1/");  
    15.             GroupCollection Groups = context.Web.SiteGroups;  
    16.             // Assume that there is a "Owners" group, and the ID=7.  
    17.             Group ownersGroup = Groups.GetById(7);  
    18.             context.Load(ownersGroup.Users);  
    19.             context.ExecuteQuery();  
    20.             foreach(User owner in ownersGroup.Users)   
    21.             {  
    22.                 Console.writeLine(owner.Title);  
    23.             }  
    24.         }  
    25.     }  
    26. }  
Thanks for reading my blogs.