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
  •  | 
  •  

Domanda

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

È stato utile?

Soluzione

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"]}")
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top