TermStore.CreateGroup method (String, Guid)

Creates a new Group object in a TermStore.

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

Syntax

'Declaration
Public Function CreateGroup ( _
    name As String, _
    groupId As Guid _
) As Group
'Usage
Dim instance As TermStore
Dim name As String
Dim groupId As Guid
Dim returnValue As Group

returnValue = instance.CreateGroup(name, _
    groupId)
public Group CreateGroup(
    string name,
    Guid groupId
)

Parameters

  • name
    Type: System.String

    The name of the new Group being created.

  • groupId
    Type: System.Guid

    The ID of the new Group being created.

Return value

Type: Microsoft.SharePoint.Taxonomy.Group

Exceptions

Exception Condition
UnauthorizedAccessException

The current user has insufficient permissions to perform this operation.

ArgumentException

The name parameter is invalid. It either contains invalid characters or is too long.

ArgumentException

Group names must be unique.

ArgumentNullException

The name cannot be a null reference (Nothing in Visual Basic) or empty.

Remarks

The name cannot exceed 255 characters, and it cannot contain any of the following illegal characters: ; " < > | & tab.

In addition, the name must be a unique group name within the current TermStore.

The current user must have ManageTermStore permission in order to use this method.

CommitAll() must be called in order to save this change to the database.

See also

Reference

TermStore class

TermStore members

CreateGroup overload

Microsoft.SharePoint.Taxonomy namespace

Name