AddUserCollectionToRole Method

The AddUserCollectionToRole method of the Users and Groups service adds the collection of users to the specified site group.

Parameters

roleName   A string that contains the name of the site group to add users to.

usersInfoXML   A System.Xml.XmlNode object that contains information about the users to add in the following form:

<Users>
   <User LoginName="DOMAIN\User1_Alias" Email="User1_E-mail" Name="User1_Display_Name" Notes="Notes"/>
   <User LoginName="DOMAIN\User2_Alias" Email="User2_E-mail" Name="User2_Display_Name" Notes="Notes"/>
   .
   .
   .
</Users>

Example

The following code example adds users to a specified site group on the current site. The example assumes the existence of a local XML file that contains the information about the users to add, which is loaded into a System.Xml.XmlDocument object.

This example requires that a using (C#) or Imports (Visual Basic .NET) directive be included for the System.Xml namespace.

Requirements

Platforms: Microsoft Windows Server 2003

Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/UserGroup.asmx