1
  1. How to get last modified date of a sharepoint group.
  2. how to get date when a user is added to a sharepoint group.

thanks for your help.

Arvind

2 Answers2

3

You can get the "Creation" and "Last Modified" Date through following Code:

SPList groupInformationList = SPContext.Current.Web.SiteUserInfoList;

SPListItem grpItem = groupInformationList.Items.GetItemById(group.ID); // Pass the ID of group
// OR, SPListItem grpItem = web.SiteUserInfoList.GetItemById(web.SiteGroups["group_name"].ID);

string groupCreationDate = Convert.ToDateTime(grpItem[SPBuiltInFieldId.Created]).ToString("MM/dd/yyyy hh:mm tt"); //Group Creation Date

string groupLastModifiedDate = Convert.ToDateTime(grpItem[SPBuiltInFieldId.Modified]).ToString("MM/dd/yyyy hh:mm tt"); // Group Modification Date
0

I do not know of an out of the box way to do this. The SPGroup and SPUserCollection classes do not contain dates. And even looking in the content database (which is unsupported), neither the Groups or GroupMembership tables have dates.

Rich Bennema
  • 10,295
  • 4
  • 37
  • 58