locked
SharePoint Groups Created date RRS feed

  • Question

  • Hello, 

    I have a quick question about groups in SharePoint. I know there are ways to display a Sharepoint user created date. Can you do the same for a group? For example, say I created Group1. Is there anyway in SharePoint that will show the date when Group1 was created? I have been unable to find this.

    Thanks!

    Chris

    Wednesday, May 23, 2012 2:57 PM

Answers

  • Hi Chris,

    SharePoint by default doesn’t display this information in the user interface, to get the group/user information like created time, you may consider using SharePoint object model, here is the code snippet:

    public static void getGroupInformation()
            {
                using (SPSite site = new SPSite("http://siteurl"))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        SPList list = web.SiteUserInfoList;
                        SPListItemCollection icoll = list.GetItems();
                        foreach (SPListItem item in icoll)
                        {
                            Console.WriteLine("item id:{0}, item name:{1}", item.ID, item.Name);
                        }
                        SPListItem itemt = list.GetItemById(26);
                        Console.WriteLine(itemt["Created"].ToString());
                    }
                }
            }

    Thanks,
    Qiao


    Qiao Wei

    TechNet Community Support

    Thursday, May 24, 2012 10:27 AM
    Moderator

All replies

  • Hi Chris,

    SharePoint by default doesn’t display this information in the user interface, to get the group/user information like created time, you may consider using SharePoint object model, here is the code snippet:

    public static void getGroupInformation()
            {
                using (SPSite site = new SPSite("http://siteurl"))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        SPList list = web.SiteUserInfoList;
                        SPListItemCollection icoll = list.GetItems();
                        foreach (SPListItem item in icoll)
                        {
                            Console.WriteLine("item id:{0}, item name:{1}", item.ID, item.Name);
                        }
                        SPListItem itemt = list.GetItemById(26);
                        Console.WriteLine(itemt["Created"].ToString());
                    }
                }
            }

    Thanks,
    Qiao


    Qiao Wei

    TechNet Community Support

    Thursday, May 24, 2012 10:27 AM
    Moderator
  • How to get the date when the some user is added to the group?can you provide any code?

    Thanks

    Suu30

    Thursday, August 16, 2012 8:25 AM