Creates the default security groups that are associated with a site.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Visual Basic (Declaration)
Public Sub CreateDefaultAssociatedGroups ( _
userLogin As String, _
userLogin2 As String, _
groupNameSeed As String _
)
Dim instance As SPWeb
Dim userLogin As String
Dim userLogin2 As String
Dim groupNameSeed As String
instance.CreateDefaultAssociatedGroups(userLogin, userLogin2, groupNameSeed)
public void CreateDefaultAssociatedGroups (
string userLogin,
string userLogin2,
string groupNameSeed
)
Parameters
- userLogin
The account name of the primary administrator of the site.
- userLogin2
The account name of the secondary administrator of the site.
- groupNameSeed
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.