How to get Sharepoint user group ,permission level, created , Created by ,Modified, Modified by using CSOM

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/286304

  •  17-02-2021
  •  | 
  •  

Question

I need to get the User group details. GroupName, Permissions levels, Created by Created date, Modified by , Modified Date. I am able to get the Group Name and Permission Levels. How to get the Created by Created date, Modified by , Modified Date in CSOM.

Thanks

Was it helpful?

Solution

You can treat UserInfoList like normal list and get these information

ClientContext clientContext = new ClientContext("http://XXXXXXXXXX/");
Web web = clientContext.Web;
List siteUserInfoList = web.SiteUserInfoList;
CamlQuery query = new CamlQuery();
query.ViewXml = "";
IEnumerable<ListItem> itemColl = clientContext.LoadQuery(siteUserInfoList.GetItems(query));
clientContext.ExecuteQuery();
foreach (var item in itemColl)
{
    Console.WriteLine($"ID:{item.Id}  Created:{item["Created"]} Modified:{item["Modified"]}")
}
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top