This documentation is archived and is not being maintained.

SPWeb.CreateDefaultAssociatedGroups Method

Windows SharePoint Services 3

Creates the default security groups that are associated with a site.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public void CreateDefaultAssociatedGroups(
	string userLogin,
	string userLogin2,
	string groupNameSeed
)

Parameters

userLogin
Type: System.String
The account name of the primary administrator of the site.
userLogin2
Type: System.String
The account name of the secondary administrator of the site.
groupNameSeed
Type: System.String
The prefix for the names of groups in this site. If an empty string is passed, the prefix used is the site title.

The default security groups that are associated with a site are groupNameSeed Visitors, groupNameSeed Members, and groupNameSeed Owners. The user account names passed in the first two arguments are added to the Owners group.

An exception is thrown if the HasUniqueRoleAssignments property returns false, indicating that role assignments for this Web site are inherited from a parent Web site.

Show: