Compartilhar via


SPGroup.AddUser Method (String, String, String, String)

Adds the user who is specified by a particular user name, email address, display name, and notes to the group.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Sub AddUser ( _
    loginName As String, _
    email As String, _
    name As String, _
    notes As String _
)
'Usage
Dim instance As SPGroup
Dim loginName As String
Dim email As String
Dim name As String
Dim notes As String

instance.AddUser(loginName, email, name, _
    notes)
public void AddUser(
    string loginName,
    string email,
    string name,
    string notes
)

Parameters

  • loginName
    Type: System.String

    The user name (DOMAIN\User_Alias) for the user to be added to group.

  • email
    Type: System.String

    The email address for the user to be added to group.

  • name
    Type: System.String

    The display name for the user to be added to group.

  • notes
    Type: System.String

    The notes for the user to be added to group.

See Also

Reference

SPGroup Class

SPGroup Members

AddUser Overload

Microsoft.SharePoint Namespace