Set SharePoint group description programmatically

29/01/2016 03:06

SPGroup object has Description property, but when we change that, it's not visible in group view. There is another column named 'About me' and your first description is displayed there. But after changig Description property, About me remains the same. To change About me text we need to update column in SiteUserInfo list. Here is function example.

 

private static void UpdateSPGroupDescription(SPWeb web, SPGroup group, string description)
{
 group.Description = description;
 SPFieldMultiLineText text = (SPFieldMultiLineText)web.SiteUserInfoList.Fields[SPBuiltInFieldId.Notes];
 SPListItem groupItem = web.SiteUserInfoList.GetItemById(group.ID);
 groupItem[text.InternalName] = description;
 groupItem.Update();
}