SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm programatically creating a new site with associated groups (Owners, Members etc) in MOSS 2007

When the site is created, and groups associated with the site, the groups don't appear in the Groups Quick Launch, so there is no direct way to edit group membership without trawling through the list of all groups.

Is there an easy way/property to set in C# that will make the new groups appear in the site's Quick Launch?



share|improve this question

You need to add it to the appropriate SPWeb's propertybag.

if ( yourWeb.Properties.ContainsKey("vti_associategroups"))
    yourWeb.Properties["vti_associategroups"] += ";" + yourGroup.Id; // append to existing groups
share|improve this answer

This worked for me and the group(s) show up as well. SPSite site = new SPSite("http://localhost"); SPWeb web = site.OpenWeb(); SPUser user = web.CurrentUser; web.SiteGroups.Add("MyGroup", user, user, "My description"); SPGroup g = web.SiteGroups["MyGroup"]; web.AssociatedGroups.Add(g); web.Update();

share|improve this answer

For SharePoint 2013 and SharePoint Online 2013 wave, web.Properties is not available anymore and web.AllProperties does not have an Update() method. Even more, simply setting properties and updating the web does not work. I've come to this solution:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.