AddUserToGroup method

UserGroup.AddUserToGroup method

Adds the user to the specified group.

Namespace:  WebSvcUserGroup
Assembly:  STSSOAP (in STSSOAP.dll)

[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/directory/AddUserToGroup", RequestNamespace = "http://schemas.microsoft.com/sharepoint/soap/directory/", 
	ResponseNamespace = "http://schemas.microsoft.com/sharepoint/soap/directory/", 
	Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void AddUserToGroup(
	string groupName,
	string userName,
	string userLoginName,
	string userEmail,
	string userNotes
)

Parameters

groupName
Type: System.String

A string that contains the name of the group.

userName
Type: System.String

A string that contains the display name of the user.

userLoginName
Type: System.String

A string that contains the user name (DOMAIN\User_Alias) of the user.

userEmail
Type: System.String

A string that contains the e-mail address of the user.

userNotes
Type: System.String

A string that contains notes for the user.

The following example adds a user to a group.

Web_Reference_Folder_Name.UserGroup usrgrpService = new Web_Reference_Folder_Name.UserGroup();
usrgrpService.Credentials= System.Net.CredentialCache.DefaultCredentials;

usrgrpService.AddUserToGroup("Group_Name","User_Display_Name",
    "DOMAIN\\User_Alias","User_E-mail","Notes");
Show:
© 2016 Microsoft